Skip to content

Add better handling for the azure marketplace updates - #4221

Open
sayanchowdhury wants to merge 1 commit into
mainfrom
sayan/fix-azure-marketplace-script
Open

Add better handling for the azure marketplace updates#4221
sayanchowdhury wants to merge 1 commit into
mainfrom
sayan/fix-azure-marketplace-script

Conversation

@sayanchowdhury

Copy link
Copy Markdown
Member

This commit fixes:

  • Add better parsing for the LTS, earlier this was broken and the LTS release was not found in the list of supported channels.
  • Update the account_name to flatcar0001
  • We hitting the 100 limit for the Azure images no on a regular basis so added a threshold to remove the images when the number is higher than 95
  • Add the option to delete the draft versions which is quite difficult to do manually as it involves time and effort and the script works a bit differently where it handles channel across plans where if any thing needs to rectified then all the plans needs to be visited and handled manually. The commit eases the process a bit
  • Add a dry run mode to check if everything will be well run
  • Formatting using black

AI Usage:

  • Used to find the endpoints of the Microsoft API-
  • Used to add comments & helpers.
  • Implement the dry-run feature.

This commit fixes:
- Add better parsing for the LTS, earlier this was broken and the LTS
  release was not found in the list of supported channels.
- Update the account_name to flatcar0001
- We hitting the 100 limit for the Azure images no on a regular basis
  so added a threshold to remove the images when the number is higher
  than 95
- Add the option to delete the draft versions which is quite difficult
  to do manually as it involves time and effort and the script works
  a bit differently where it handles channel across plans where if any
  thing needs to rectified then all the plans needs to be visited and
  handled manually. The commit eases the process a bit
- Add a dry run mode to check if everything will be well run
- Formatting using black

Signed-off-by: Sayan Chowdhury <sayan.chowdhury2012@gmail.com>

Copilot AI 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.

Pull request overview

Improves the Azure Marketplace publishing automation to better handle LTS channel resolution, reduce SKU version-limit churn, and add operational controls (draft deletion + dry-run) to make maintenance less manual.

Changes:

  • Parse channel-info.txt into a key/value map, improve plan discovery, and add LTS year-to-plan resolution (lts_2024lts2024).
  • Add safeguards for Azure’s 100 image-version cap by deprecating the oldest versions above a threshold, plus add “delete draft version” workflow support.
  • Add --dry-run, improve CLI help/validation, and propagate submission failures via a non-zero exit code.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +462 to +465
if not args.test_mode and plan == "lts":
plan = resolve_lts_plan(channel_info, args.version)
if plan is None:
return
Comment on lines +118 to +120
logging.error(
f"Could not LTS year for version {version} in channel-info.txt, matches: {matches}"
)
Comment on lines +321 to +324
if dry_run:
print(f"[dry-run] Would POST configure for {offer}/{plan}:")
print(json.dumps(payload, indent=2))
return True
Comment thread ci-automation/release/azure_marketplace_publish.py
Comment thread ci-automation/release/azure_marketplace_publish.py

@chewi chewi left a comment

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.

Seems okay, but shouldn't it deprecate more than one at a time? You might still be over the threshold after running it.

@sayanchowdhury

Copy link
Copy Markdown
Member Author

I'm just deprecating one version at a time, because that's how much we need and what I've been doing manually.

I've just replicated what I've been doing manually

@chewi chewi left a comment

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.

I think Copilot may have raised some valid concerns, but I trust your judgement here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Testing / in Review

Development

Successfully merging this pull request may close these issues.

3 participants