Skip to content

Add tag version validation against main branch in CI#470

Closed
Copilot wants to merge 4 commits into
developfrom
copilot/compare-tag-to-latest-version
Closed

Add tag version validation against main branch in CI#470
Copilot wants to merge 4 commits into
developfrom
copilot/compare-tag-to-latest-version

Conversation

Copilot AI commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

Prevents creating tags that don't increment from the current main branch version. Without this check, tags could be created with versions equal to or lower than main, causing release confusion.

Changes

  • New workflow step: Extracts version from fastkml/about.py on main branch and compares against tag being pushed
  • Version parsing: Uses packaging.version.parse() to properly handle pre-releases, dev versions, and semantic versioning
  • Security: Environment variables prevent shell injection from malicious tag names
  • Error handling: Validates version extraction and catches InvalidVersion with clear error messages

Example Behavior

# On main: __version__ = "1.3.0"
# Pushing tag 1.4.0 → ✓ passes
# Pushing tag 1.3.0 → ✗ fails (not greater than main)
# Pushing tag 1.2.0 → ✗ fails (not greater than main)

Runs only when tags are pushed, positioned after the existing tag name validation step.

Original prompt

Compare this tag to the latest version on main


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@semanticdiff-com

semanticdiff-com Bot commented Oct 28, 2025

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  .github/workflows/run-all-tests.yml  0% smaller

@coderabbitai

coderabbitai Bot commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: cleder <1218010+cleder@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Preparing review...

2 similar comments
@github-actions

Copy link
Copy Markdown

Preparing review...

@github-actions

Copy link
Copy Markdown

Preparing review...

Copilot AI and others added 2 commits October 28, 2025 14:03
Co-authored-by: cleder <1218010+cleder@users.noreply.github.com>
Co-authored-by: cleder <1218010+cleder@users.noreply.github.com>
Copilot AI changed the title [WIP] Compare tag to the latest version on main Add tag version validation against main branch in CI Oct 28, 2025
Copilot AI requested a review from cleder October 28, 2025 14:09
@cleder cleder closed this Oct 28, 2025
@cleder cleder deleted the copilot/compare-tag-to-latest-version branch October 28, 2025 15:39
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