-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat(ci): add support for user-defined jobs #417
Conversation
For discussion, writing out the slug-driven approach I had pictured:
Would tell us that:
With a hypothetical buildkite workflow (i have no idea what buildkite looks like, let's pretend it's vaguely github-shaped):
I also figured it would be more ergonomic to have builtins and user-defined jobs sharing the publish-jobs / upload-jobs array, but I respect wanting to make them separate arrays. |
Hm, that slug approach seems reasonable. While it commits us to a specific directory structure in the target repo, that's not really a bad thing. I do still want to keep it separated out by CI system. I can see a scenario where someone has more than one configured in the same repo and doesn't have 1:1 job parity between systems. Even if it requires more work from the user, I think it's better to specify extra jobs per CI system. |
Can you envision an approach where the per-ci-system stuff can be sugarred away for people who don't need it? |
Do you think that's necessary? Specifying a hash isn't enough extra work for the user that supporting a sugar syntax in addition to the other one feels like it's a bit more complex than we want to commit to. |
tbh I'll be surprised if any user ever needs that level of generality, so I respect the desire to have it available but it seems like an ergonomics pain to force everyone to refer to the possibility but never use it. |
f1afaa2
to
1221dc2
Compare
I got talked into the simpler list syntax in place of the more complex hash syntax; pushed a version with that. Think this is ready now, save docs. |
ac11e62
to
d1655a9
Compare
The most recent version places both types of publish jobs in a single array. We distinguish between types via prefixing user jobs with a publish-jobs = ["homebrew", "@greeter"]
|
f25f7e5
to
ddada20
Compare
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.
General impl seems right, just some gunk from how many iterations this went through to clean up
let string = s.to_string(); | ||
if let Some(stripped) = string.strip_prefix("./") { | ||
stripped.to_owned() | ||
} else { | ||
string | ||
} |
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.
the ./ is stripped by this point in the code, so no need to map
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.
Not true, the publish_jobs
vec we're fetching from has the original prefixed names.
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.
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.
Good question! I'm... not really sure? I checked and it's absolutely true that the FromStr
is constructing the PublishStyle
with no ./
prefix, while the type in the task does have it until I strip it here.
ddada20
to
3d2be72
Compare
This adds support for user-defined jobs in CI. Currently, we support publish jobs specifically, and these run parallel with other publish jobs. These are specified in TOML via the
user_publish_jobs
hash:Fixes #379.