Skip to content

[containerapp] Add new options for labels mode#8324

Merged
zhoxing-ms merged 15 commits intoAzure:mainfrom
Tratcher:feature-labelsmode
Jan 17, 2025
Merged

[containerapp] Add new options for labels mode#8324
zhoxing-ms merged 15 commits intoAzure:mainfrom
Tratcher:feature-labelsmode

Conversation

@Tratcher
Copy link
Copy Markdown
Contributor

This adds support for the new containerapp activeRevisionMode 'labels' mode and the associated target-label option. These are used when creating or updating applications. There are also new commands to show the history of label revision assignments.

All commands except label-history already exist and need to be overridden by the extension to support these new features.

Needs tests.


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

  • 'az containerapp create': New target-label option for Labels revision mode.
  • 'az containerapp update': New revisions-mode and target-label options for Labels revision mode.
  • 'az containerapp up': New revisions-mode and target-label options for Labels revision mode.
  • 'az containerapp label-history': New list and show commands to see label revision assignment history.
  • 'az containerapp revision set-mode': New target-label option for Labels revision mode.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Nov 26, 2024

⚠️Azure CLI Extensions Breaking Change Test
⚠️containerapp
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd containerapp create cmd containerapp create added parameter target_label
⚠️ 1010 - ParaPropUpdate containerapp create cmd containerapp create update parameter revisions_mode: updated property choices from ['multiple', 'single'] to ['labels', 'multiple', 'single']
⚠️ 1011 - SubgroupAdd containerapp label-history sub group containerapp label-history added
⚠️ 1006 - ParaAdd containerapp revision set-mode cmd containerapp revision set-mode added parameter target_label
⚠️ 1010 - ParaPropUpdate containerapp revision set-mode cmd containerapp revision set-mode update parameter mode: updated property choices from ['multiple', 'single'] to ['labels', 'multiple', 'single']
⚠️ 1006 - ParaAdd containerapp up cmd containerapp up added parameter revisions_mode
⚠️ 1006 - ParaAdd containerapp up cmd containerapp up added parameter target_label
⚠️ 1006 - ParaAdd containerapp update cmd containerapp update added parameter revisions_mode
⚠️ 1006 - ParaAdd containerapp update cmd containerapp update added parameter target_label

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @Tratcher,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @Tratcher,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Nov 26, 2024

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@github-actions
Copy link
Copy Markdown
Contributor

Hi @Tratcher

Release Suggestions

Module: containerapp

  • Update VERSION to 1.1.0b2 in src/containerapp/setup.py

Notes

@Greedygre
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 8324 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Jan 2, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@Greedygre
Copy link
Copy Markdown
Contributor

Greedygre commented Jan 6, 2025

Hi @Tratcher
This PR LGTM except above ni comments, can you take a look and address them?
Also, please sync the main branch to fix the integration test.
Thanks.

@Tratcher Tratcher requested a review from kairu-ms as a code owner January 6, 2025 23:48
Greedygre
Greedygre approved these changes Jan 9, 2025
Comment on lines -1260 to +1273
if ingress and not target_port:
target_port = 80
logger.warning("No ingress provided, defaulting to port 80. Try `az containerapp up --ingress %s --target-port <port>` to set a custom port.", ingress)
if ingress and not target_port and target_port != 0:
target_port = 0
logger.warning("No target-port provided, defaulting to auto-detect. Try `az containerapp up --ingress %s --target-port <port>` to set a custom port.", ingress)
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.

Will this change lead to a breaking change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, the auto-detection will still cover the old scenario where the app was listening on port 80.

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.

Sounds good

Comment on lines +404 to +409
containerapp label-history show:
rule_exclusions:
- missing_command_test_coverage
containerapp label-history list:
rule_exclusions:
- missing_command_test_coverage
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.

Why not add some tests for these commands?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The commands won't work properly until our next control plane deployment goes out, there was a change in the object structure. I can add tests after that.

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.

Got it, thanks~

@zhoxing-ms zhoxing-ms merged commit 70983a7 into Azure:main Jan 17, 2025
Jenniferyingni pushed a commit to Jenniferyingni/azure-cli-extensions that referenced this pull request Feb 9, 2025
@Tratcher Tratcher deleted the feature-labelsmode branch July 1, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot ContainerApp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants