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

feat: avm/res/compute/gallery: Added UDT applicationsType #3817

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

johnlokerse
Copy link
Contributor

@johnlokerse johnlokerse commented Nov 20, 2024

Description

This PR adds the applicationsType UDT and updates existing UDTs to follow AVM standards.

Tagging owner: @ReneHezser

Pipeline Reference

Pipeline
avm.res.compute.gallery

Type of Change

  • Update to CI Environment or utilities (Non-module affecting changes)
  • Azure Verified Module updates:
    • Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in version.json:
      • Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description.
      • The bug was found by the module author, and no one has opened an issue to report it yet.
    • Feature update backwards compatible feature updates, and I have bumped the MINOR version in version.json.
    • Breaking changes and I have bumped the MAJOR version in version.json.
    • Update to documentation

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • I have run Set-AVMModule locally to generate the supporting module files.
  • My corresponding pipelines / checks run clean and green without any errors or warnings

@johnlokerse johnlokerse requested review from a team as code owners November 20, 2024 13:00
@avm-team-linter avm-team-linter bot added the Needs: Module Owner 📣 This module needs an owner to develop or maintain it label Nov 20, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 Maintainers need to triage still label Nov 20, 2024

Important

The "Needs: Triage 🔍" label must be removed once the triage process is complete!

Tip

For additional guidance on how to triage this issue/PR, see the BRM Issue Triage documentation.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue label Nov 20, 2024

Important

If this is a module-related PR, being submitted by the sole owner of the module, the AVM core team must review and approve it (as module owners can't approve their own PRs).

To indicate this PR needs the core team''s attention, apply the "Needs: Core Team 🧞" label!

The core team will only review and approve PRs that have this label applied!

@johnlokerse johnlokerse changed the title avm/res/compute/gallery: Added UDT applicationsType feat: avm/res/compute/gallery: Added UDT applicationsType Nov 20, 2024
@ReneHezser ReneHezser self-assigned this Nov 20, 2024
Copy link
Contributor

@ReneHezser ReneHezser left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. I added some small comments.

type roleAssignmentType = {
@sys.description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
name: string?
import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.3.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

While this is a valid place to import external UDTs, we agreed to import them at the location where they are used. This way it is clear where they come from.
I'd put the import roleAssignmentType right before the param roleAssignments.
This applies to all imports and references of imported types (AVM common or your own).

Copy link
Contributor Author

@johnlokerse johnlokerse Nov 20, 2024

Choose a reason for hiding this comment

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

💡 Thanks for the feedback! Is the single line import required for this type as well?
import { identifierType, purchasePlanType, resourceRangeType } from './image/main.bicep'

Or is this fine as it is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nevermind, these are used within a UDT so must be in the one-liner :)

Copy link
Contributor

Choose a reason for hiding this comment

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

One point may have gotten lost a bit.

Hey @johnlokerse, long time no see. 😄 To build on top of what @ReneHezser said: Just for the types that you import from other templates, please import them on top of where they are used. For example:

import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.3.0'
@sys.description('Optional. The lock settings of the service.')
param lock lockType?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just makes it a bit easier to find - especially if the module would happen to not have any other types :) (in know that's not the case for you, but I wanted to mention it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Also, I have moved the imports at the UDTs to above the @export():

CleanShot 2024-11-25 at 09 18 18@2x

avm/res/compute/gallery/main.bicep Outdated Show resolved Hide resolved
@ReneHezser ReneHezser removed the Needs: Triage 🔍 Maintainers need to triage still label Nov 20, 2024
@johnlokerse
Copy link
Contributor Author

Thank you for your contribution. I added some small comments.

Thanks! Implemented the comments. Could you re-check it to see if it's as expected?

ReneHezser
ReneHezser previously approved these changes Nov 20, 2024
Copy link
Contributor

@ReneHezser ReneHezser left a comment

Choose a reason for hiding this comment

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

Thanks again for your contribution.

For next time, please do not solve conversations. Usually, the reviewer does that after checking again. This makes it easier for us to do the reviews on many modules at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Module Owner 📣 This module needs an owner to develop or maintain it Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants