Skip to content

Refactor templates to use shared implementation - #14703

Merged
chcosta merged 11 commits into
dotnet:mainfrom
chcosta:chcosta/template-refactor
Apr 11, 2024
Merged

chcosta merged 11 commits into
dotnet:mainfrom
chcosta:chcosta/template-refactor

Conversation

@chcosta

@chcosta chcosta commented Apr 8, 2024 •

Copy link
Copy Markdown
Member

Fixes dotnet/dnceng#2168

This change refactors .NET Engineering's templates to use core templates for shared logic. Most of the notes on this change are in the included eng/common/template-guidance.md file.

Validation jobs:

Not sure of a great way to review these changes.

To double check:

@chcosta
chcosta requested review from a user, dougbu and mmitche April 8, 2024 22:10
@chcosta chcosta self-assigned this Apr 8, 2024
@chcosta
chcosta requested a review from premun April 9, 2024 00:04
Comment thread eng/common/template-guidance.md Resolved
Comment thread eng/common/template-guidance.md Resolved
Comment thread eng/common/template-guidance.md Resolved
ghost
ghost previously approved these changes Apr 10, 2024

@ghost ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor comments

Comment thread eng/common/template-guidance.md Resolved
Comment thread eng/common/core-templates/job/job.yml Resolved
Comment thread eng/common/template-guidance.md Resolved
Comment thread eng/common/template-guidance.md Resolved
ghost
ghost previously approved these changes Apr 11, 2024
@chcosta
chcosta force-pushed the chcosta/template-refactor branch from e912651 to 5146457 Compare April 11, 2024 18:05
ghost
ghost previously approved these changes Apr 11, 2024
Comment thread eng/common/core-templates/job/job.yml Outdated
BuildDropPath: '$(Build.SourcesDirectory)/artifacts'

# 1es specific parameters
templateIs1ESManaged: ''

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of this name. The template (this template and ones like it) is not 1ES-managed. It's the overall pipeline that chooses to use the 1ES PT. I used an is1ESPipeline parameter for these choices in helix-machines though I'm considering removing that complately…

Have you tested using the 1ES-PT predefined variables❔ There may be no need for new parameters at all if we can leverage OneESPT and perhaps OneESPT.BuildType. From a quick look at the expanded YAML for an official run, it's clear the predefined variables are defined at the top of every job. I suspect our stage and job templates may still need parameters but am not sure. Might want to check in the 1ES Pipeline Templates (1ES PT) / Support - General Teams channel for their thoughts on predefined variable use during template expansion before going too far down this path.

(I may test things out soon too.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template (this template and ones like it) is not 1ES-managed

IMO, the template is managed by 1ES because of its requirement on extends. I admit, it's a bit pedantic though and i'm happy to use whatever parameter causes less angst. i'll change it to is1ESPipeline.

I think parameters are the right implementation for the desired behavior and I don't see the need to add in 1ES variables (at this time).

@chcosta
chcosta merged commit 3f98460 into dotnet:main Apr 11, 2024
@chcosta
chcosta deleted the chcosta/template-refactor branch April 11, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Arcade templates to support 1ES PT and non-1ES PT flows.

3 participants