-
Notifications
You must be signed in to change notification settings - Fork 64
[DRAFT] VMR Verification in SBRP PRs #1262
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
base: main
Are you sure you want to change the base?
Conversation
Hmm, default value for The alternative would be to rename this pipeline to be Another option would be to have a different template for source-only builds. Pipelines would reference the template that is most appropriate for the repo, i.e. all legs, source-only, Windows-only, etc. |
I'm not fond of a name convention based approach. It is not intuitive and doesn't provide a very good UX for changing the configuration down the road. It would be nice to have a scalable solution that would solve all future scenarios e.g. Windows only legs, single linux leg, etc. plus a combination of configurations Could the parameters be changed to variables which can then be saved in the AzDO pipeline configuration? |
Thanks - yes we could use variables instead - will test it out, and expand for other scenarios. |
/azp run source-build-reference-packages-unified-build |
Azure Pipelines failed to run 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
5d7d402
to
deb23a7
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s), but failed to run 1 pipeline(s). |
6494c6a
to
c43bc28
Compare
So, this works, but it is a draft PR and will not be merged. |
Based on the comment above (#1262 (comment)) I've investigated what is possible and implemented a solution using one of the available options. There is a different way to solve this, and I wanted to to call out those two options and close on this, as it will become a plan for other types of build job conditioning. We want to allow repos to run VMR Verification of the smaller set of jobs, than what is a default set for PRs. For instance, in this repo, This variable is a runtime variable, and can only be used in a limited number of places and scenarios, due to the following:
Based on the goal and constraints, there are 2 options:
Option 1 seems cleaner as all unified-build jobs get conditioned with a single In this case, where we want to skip all unified-build stages/jobs, I prefer option 1, as it seems a better way to condition larger groups of stages/jobs. In a different case, where we, for instance, want to only run Windows jobs, we could also use a parameter, to pass it around templates, or we could use the runtime variable directly in Runtime variable name could be more descriptive - instead of @ViktorHofer @MichaelSimons @mmitche what do you think of this model and proposal for conditioning VMR build jobs? We do have an issue tracking a request for allowing a scoped-down builds of unified-build pipeline: dotnet/dotnet#1068 This PR, and dependent VMR changes, will contribute to that work. |
I think Option 1 is the more attractive option. With this option, is it possible to define the parameter as a bool and do a conversion? This could be extended to support casing variants.
|
It's not possible unfortunately, as conversion to bool would happen at compile-time. I also tried the option that was suggested by Copilot - Here's what I got in a chat:
Runtime variable can be used to conditionally include a stage or template - option 2 above. But, cannot be converted to boolean in a compile-time conversion, to be passed in to a template. This is a really unfortunate constraint. |
Another option (already discussed) would be to, rather than having eng/common/vmr-build-pr.yml be the root YAML for the job, have a repo implement a stub. The stub would have the triggers and call vmr-build-pr.yml, specifying that this is a repo that only needs source-build legs.
Is it possible to use the conditional include of a template to include a variables template which defines boolean typed variables, which then get used? Therefore you're not actually converting the variable directly to a boolean. |
This is interesting and likely a cleaner option, as we'd be able to use bool parameter in vmr templates. It also aids maintainability as it's easier to update the YML than to request an update pipeline configuration - something that is not owned by the repo owners. @MichaelSimons @ViktorHofer any opinion on this approach? It makes pipeline yml and intent more clear and descriptive, and any modification becomes straightforward. I will modify the pending VMR PR accordingly, based on feedback.
I believe those variables are evaluated at compile-time. It's worth a check. |
I think this is worthwhile. I would like to see what this would look like. |
Will prepare a draft PR to test this out. |
Here's how the changes would look: c51f6bf With this approach, we would be adding a requirement for another repo-specific YML. Various elements need to be moved to this new YML, including This would diminish the value of the current shared pipeline YML. The benefit is that we can use YML |
The root pipeline is still a template that is easy to copy between repos, so no concerns there. One suggestion is that I would avoid going with booleans to conditionalize the VMR PR testing that is performed. Instead, long term it may be cleaner to pass this info as a list. e.g.:
|
Yeah, I agree with a list of verifications, and the intent to use these types of checks for PR verification jobs only. The alternative would be to use these conditions for every job we run, which would make YMLs much harder to read. However, This would imply that we need the following default list of items::
We'd end up with something list this:
|
I don't think you'd need the default list to exist in both templates. You'd set the default in the outer template to something like |
Hmm, never used that before. Is What we will have are 3 levels of YMLs:
|
Azure Pipelines successfully started running 1 pipeline(s). |
Here are the final changes that work: dotnet/dotnet@main...vmrverification.list Full verification build was successful: https://dev.azure.com/dnceng/internal/_build/results?buildId=2729174&view=results I will test few more repo-side options in this PR and switch to a repo-specific pipeline yml - we will get rid of shared arcade yml. |
This looks good. One thing that I just realized is that we should split the source-build verification into stage1 and stage2. SBRP should only need stage1 which is what I would expect other repos would want as well. |
Yeah, makes sense, I was thinking of that. How about |
/azp run source-build-reference-packages-unified-build |
Azure Pipelines failed to run 1 pipeline(s). |
Makes sense. |
/azp run source-build-reference-packages-unified-build |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run source-build-reference-packages-unified-build |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
7af90dd
to
eef134b
Compare
/azp run source-build-reference-packages-unified-build |
Azure Pipelines successfully started running 1 pipeline(s). |
|
||
stages: | ||
- template: /eng/pipelines/templates/stages/vmr-build.yml@vmr | ||
parameters: | ||
isBuiltFromVmr: false | ||
verifications: [ "unified-build-browser-wasm" ] | ||
scope: lite |
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.
WHat's the difference between scope
and verifications
?
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.
scope
is used to condition jobs in CI and PRs, in an all-or-nothing fashion. lite
jobs are considered a subset of full
.
verifications
contains the list of jobs that are considered to be verifications and currently ran in both lite
and full
scopes. This parameter allow us to only run specific verifications. This might only make sense for lite
scope, therefore I added the scope
parameter to be explicit.
Here's where scope is currently used: https://github.com/dotnet/dotnet/blob/1ec8c1e9aebde14c1813d1c878dda7fd38ab298f/eng/pipelines/templates/stages/source-build-stages.yml#L65 and https://github.com/dotnet/dotnet/blob/1ec8c1e9aebde14c1813d1c878dda7fd38ab298f/eng/pipelines/templates/stages/vmr-verticals.yml#L171
lite
is the first value listed, so it is the implicit default value - https://github.com/dotnet/dotnet/blob/1ec8c1e9aebde14c1813d1c878dda7fd38ab298f/eng/pipelines/templates/stages/vmr-build.yml#L13-L20 We might not need to specify scope: lite
in repo pipeline.
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.
Got it.
eef134b
to
45b9b67
Compare
/azp run source-build-reference-packages-unified-build |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run source-build-reference-packages-unified-build |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run source-build-reference-packages-unified-build |
Azure Pipelines successfully started running 1 pipeline(s). |
d4a3d0c
to
9683d62
Compare
/azp run source-build-reference-packages-unified-build |
Azure Pipelines successfully started running 1 pipeline(s). |
Verification of changes needed for source-only runs of the VMR build pipeline.