-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate types from the Github Actions JSON schema #43
Conversation
Signed-off-by: Ringo De Smet <ringo@de-smet.name>
@@ -0,0 +1,7 @@ | |||
import * as fs from "fs"; | |||
import zodToJsonSchema from "zod-to-json-schema"; | |||
import { Config } from "../src/config"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be easy to add (a version of) this file to the PR? So we can see what sort of things would be written to the schema?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenwit I think I committed this file too early. It should have been part of the next PR, together with the schema config file you ask for, where I would go into reading a repository specific config file, with schema validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we haven't been able to find a time that fits yet for a talk, I might as well ask some questions here to try and clear things up.
I and many other developers, such as @jaxxstorm, have generated Github Actions workflows with Typescript. Is this supposed to be the same? In that case, can we please use jaxxstorm's package instead? Potentially add what we need to that package too?
I also feel there are reasons not to generate with Typescript anymore, especially after reusing workflows became a thing. In my experience, it lowered the amount of moving parts.
I might be totally off track here, in that case; sorry about that.
@cobraz you are not off-track and I'm all in for reuse. A pitty we couldn't find a moment to discuss in a call. My main take for now is to stay close to what Pulumi has in the The previous big PR (#39) was already mimicking the Pulumi ci-mgmt setup, but I replicated too much in a single PR. This PR is only one smaller part of it so you can review more easily, which was a remark in that previous big PR. With our without using reusable workflows, release engineering best practices are to pin all the versions in use. So in case of workflow reuse, I will never point to "latest on main". One breaking change would possibly block everybody. Hence, I want PRs in all the repositories when I want to bump to a new tagged version of a workflow. Generating such update PRs in all the provider repos is also automated in I created a first tag to test reusable workflows: https://github.com/pulumiverse/infra/tree/actions-workflows-v0.0.1 In case we don't invest in workflow reuse and would choose to generate complete workflows, I want to test the generation manually for a single provider, only later having automation to rollout such workflow changes to all repositories also via automated PRs. I hope the strategy is transparent now, you approve and I can make more progress. 😉 |
@tenwit @cobraz @usrbinkat with all the feedback given, is it OK for one of you to approve so you allow me to make progress? |
Related: #40
About a month ago, I created a massive PR (#39) containing code to automate the creation of workflows for the different provider repositories. That PR was too big to review and it wasn't clear what it needed to solve. The need for this type of automation was then described in #40.
I will now chop up that work in a series of smaller PRs, of which this is a first one.
The setup added in the
workflows
folder is a regular NodeJS project (so no Pulumi code involved) which eventually will generate the required the needed workflows and utility files (.github/dependabot.yml
,CODEOWNERS
, ...) in a provider repository.Before we land there, I want the ability to write Github Actions workflows in regular Typescript. This PR retrieves the JSON schema and creates a Typescript typings file from it.
More to come in a next PR.
Signed-off-by: Ringo De Smet ringo@de-smet.name