Add better handling for the azure marketplace updates - #4221
Add better handling for the azure marketplace updates#4221sayanchowdhury wants to merge 1 commit into
Conversation
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>
There was a problem hiding this comment.
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.txtinto a key/value map, improve plan discovery, and add LTS year-to-plan resolution (lts_2024→lts2024). - 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.
| if not args.test_mode and plan == "lts": | ||
| plan = resolve_lts_plan(channel_info, args.version) | ||
| if plan is None: | ||
| return |
| logging.error( | ||
| f"Could not LTS year for version {version} in channel-info.txt, matches: {matches}" | ||
| ) |
| if dry_run: | ||
| print(f"[dry-run] Would POST configure for {offer}/{plan}:") | ||
| print(json.dumps(payload, indent=2)) | ||
| return True |
chewi
left a comment
There was a problem hiding this comment.
Seems okay, but shouldn't it deprecate more than one at a time? You might still be over the threshold after running it.
|
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
left a comment
There was a problem hiding this comment.
I think Copilot may have raised some valid concerns, but I trust your judgement here.
This commit fixes:
AI Usage:
dry-runfeature.