Skip to content
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

Update build workflow to publish bicep types to ACR #7693

Merged
merged 5 commits into from
Jun 20, 2024

Conversation

sk593
Copy link
Contributor

@sk593 sk593 commented Jun 18, 2024

Description

Update build workflow to publish bicep types to ACR

Type of change

  • This pull request fixes a bug in Radius and has an approved issue (issue link required).
  • This pull request adds or changes features of Radius and has an approved issue (issue link required).
  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).

Fixes: #issue_number

@sk593 sk593 requested review from a team as code owners June 18, 2024 22:50
name: Publish Radius bicep types to ACR
runs-on: ubuntu-latest
# Don't push on PR
if: github.repository == 'radius-project/radius' && ((startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is that we only publish on merge to main or during a release in this workflow. The functional test workflow will also have a step to publish types to ACR and these will be tagged with the PR version.

Open to suggestions if that doesn't sound like the right idea. Since the functional tests are where we'd consume the uploaded types (i.e. in all our test bicep templates), it made most sense to upload them as part of that workflow instead of here

Copy link
Contributor

Choose a reason for hiding this comment

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

Open to suggestions if that doesn't sound like the right idea. Since the functional tests are where we'd consume the uploaded types (i.e. in all our test bicep templates), it made most sense to upload them as part of that workflow instead of here

We could do that, or we could keep the bicep types on disk.

For the functional tests, we'll need to update/generate a bicep config to either:

  • Reference the specific version associated with the PR from the OCI registry (like we do with magpie)
  • Reference a file on disk

For the purposes of this PR, I think you have the right idea 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The plan was to generate a temporary bicep config in the functional test folder that has the PR-specific provider reference during pipeline runs. So we upload to ACR with the PR-specific tag and then the tests will pull from that provider tag.

There will be a bicep config that permanently lives in the radius folder, but this will mostly be for development purposes and will always reference the latest tag by default

.github/workflows/build.yaml Outdated Show resolved Hide resolved
echo "OK"
- name: Generate Bicep extensibility types from OpenAPI specs
run: |
make generate-bicep-types VERSION=${{ env.REL_VERSION }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's code in generate.mk and generate.ts that takes in a version string as an argument and uses that to correctly tag the index.json file. So we'll pass in the release version here (default value is latest)

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -256,7 +256,7 @@ async function buildTypeIndex(logger: ILogger, baseDir: string, version: string)
types: readTypesJson(content),
});
}
const indexContent = await buildIndex(typeFiles, log => logOut(logger, log), {name: "radius", version: version, isSingleton: false} as TypeSettings);
const indexContent = await buildIndex(typeFiles, log => logOut(logger, log), {name: "radius", version: (version == "edge" ? "latest" : version), isSingleton: false} as TypeSettings);
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be nice if we could keep the logic about edge/latest out of this code and limit to the GH actions + makefile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Removed the check from here and added it to the build workflow instead

Copy link

github-actions bot commented Jun 19, 2024

Unit Tests

3 218 tests  ±0   3 212 ✅ ±0   4m 6s ⏱️ +14s
  261 suites ±0       6 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit bf5deb2. ± Comparison against base commit d9af59d.

♻️ This comment has been updated with latest results.

@sk593 sk593 force-pushed the upload-bicep-types-acr branch 2 times, most recently from e7d5198 to f32e6f0 Compare June 19, 2024 18:05
@@ -65,6 +65,9 @@ env:
# URL to get source code for building the image
IMAGE_SRC: https://github.com/radius-project/radius

# ACR url for bicep file uploads
ACR: 'biceptypes.azurecr.io'
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you come up with a more descriptive name for this? It looks like my comment disappeared, but its still the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, sorry I didnt see that comment. I updated to BICEP_TYPES_ACR, but I'm open to suggestions if something else seems better

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest something like BICEP_TYPES_REGISTRY. It's more neutral.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 60.99%. Comparing base (bb8da88) to head (bf5deb2).

Current head bf5deb2 differs from pull request most recent head 6dcc571

Please upload reports for the commit 6dcc571 to get more accurate results.

Files Patch % Lines
pkg/cli/bicep/tools/download_tools.go 0.00% 12 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##           feature-bicep-compiler-merge    #7693      +/-   ##
================================================================
- Coverage                         61.01%   60.99%   -0.03%     
================================================================
  Files                               520      520              
  Lines                             27008    27012       +4     
================================================================
- Hits                              16480    16476       -4     
- Misses                             9077     9083       +6     
- Partials                           1451     1453       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sk593 sk593 force-pushed the upload-bicep-types-acr branch 3 times, most recently from bf5deb2 to f4eca6e Compare June 19, 2024 21:43
@sk593 sk593 force-pushed the feature-bicep-compiler-merge branch from d9af59d to bb8da88 Compare June 19, 2024 21:55
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
@sk593 sk593 merged commit fed2462 into feature-bicep-compiler-merge Jun 20, 2024
1 check passed
@sk593 sk593 deleted the upload-bicep-types-acr branch June 20, 2024 16:22
sk593 added a commit that referenced this pull request Jul 10, 2024
# Description

Update build workflow to publish bicep types to ACR

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
sk593 added a commit that referenced this pull request Jul 22, 2024
# Description

Update build workflow to publish bicep types to ACR

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
sk593 added a commit that referenced this pull request Aug 1, 2024
# Description

Update build workflow to publish bicep types to ACR

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
sk593 added a commit that referenced this pull request Aug 2, 2024
# Description

Update build workflow to publish bicep types to ACR

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
sk593 added a commit that referenced this pull request Aug 2, 2024
# Description

Update build workflow to publish bicep types to ACR

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
sk593 added a commit that referenced this pull request Aug 5, 2024
# Description

Update build workflow to publish bicep types to ACR

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
sk593 added a commit that referenced this pull request Aug 6, 2024
# Description

Update build workflow to publish bicep types to ACR

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
sk593 added a commit that referenced this pull request Aug 7, 2024
# Description

Update build workflow to publish bicep types to ACR

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
sk593 added a commit that referenced this pull request Aug 9, 2024
# Description

Update build workflow to publish bicep types to ACR

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
sk593 added a commit that referenced this pull request Aug 12, 2024
# Description

Update build workflow to publish bicep types to ACR

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
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.

2 participants