Skip to content

fix: validate release POM coordinates - #24

Merged
iamchorchos merged 2 commits into
mainfrom
feat/javafx-volatility-surface
Jul 23, 2026
Merged

fix: validate release POM coordinates#24
iamchorchos merged 2 commits into
mainfrom
feat/javafx-volatility-surface

Conversation

@iamchorchos

Copy link
Copy Markdown
Owner

No description provided.

@codacy-production

codacy-production Bot commented Jul 23, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Coverage ∅ diff coverage · +0.00% coverage variation

Metric Results
Coverage variation +0.00% coverage variation (-1.00%)
Diff coverage diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (944de65) 1672 1532 91.63%
Head commit (e0a34c5) 1672 (+0) 1532 (+0) 91.63% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#24) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@iamchorchos
iamchorchos merged commit a239546 into main Jul 23, 2026
7 checks passed

@codacy-production codacy-production Bot 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

The PR introduces automated validation for Maven POM coordinates but contains critical logic inconsistencies in the validation script. Specifically, the thegreeklab-visualization module is missing from the update loop but included in the validation phase with inconsistent logic. Additionally, the use of non-portable sed commands may cause issues in non-Linux environments. While Codacy indicates the PR is technically up to standards, these logic gaps and the lack of unit/integration tests for the scripts represent a risk to the reliability of the release process.

About this PR

  • No unit tests or integration tests were added for the new shell and Python validation logic in 'scripts/validate-release-poms.sh'. Given this script is critical for release integrity, consider adding automated tests.
  • The PR lacks a description explaining the motivation or context for the changes. Providing context helps reviewers understand the 'why' behind the validation logic.

Test suggestions

  • Verify script correctly updates the revision property in targeted POM files.
  • Verify Python assertion fails if a module's flattened version deviates from the release version.
  • Verify Python assertion fails if any flattened POM still contains 'SNAPSHOT'.
  • Validate that the CI workflow correctly extracts the base version from a SNAPSHOT revision.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify script correctly updates the revision property in targeted POM files.
2. Verify Python assertion fails if a module's flattened version deviates from the release version.
3. Verify Python assertion fails if any flattened POM still contains 'SNAPSHOT'.
4. Validate that the CI workflow correctly extracts the base version from a SNAPSHOT revision.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

versions = [
poms[0].find(namespace + "version").text,
poms[1].find(namespace + "version").text,
poms[2].find(namespace + "parent").find(namespace + "version").text,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

This check is inconsistent with the logic used for the other modules. It should verify the version of the visualization module itself rather than its parent to ensure the artifact coordinates are correct.

Suggested change
poms[2].find(namespace + "parent").find(namespace + "version").text,
poms[2].find(namespace + "version").text,


release_version="${1:?Expected the release version as the first argument}"

for pom in pom.xml thegreeklab-core/pom.xml; do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

The thegreeklab-visualization/pom.xml file is missing from this update loop. If it also uses the <revision> property (as the core module does), the subsequent verification will fail because the version won't be updated to the release value.

Suggested change
for pom in pom.xml thegreeklab-core/pom.xml; do
for pom in pom.xml thegreeklab-core/pom.xml thegreeklab-visualization/pom.xml; do

Comment thread .github/workflows/ci.yml

- name: Validate release POM coordinates
run: |
releaseVersion="$(sed -n 's#.*<revision>\(.*\)-SNAPSHOT</revision>.*#\1#p' pom.xml)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

Suggestion: This command will fail if the POM revision does not end in '-SNAPSHOT'. Consider making the regex optional for the snapshot suffix if release-version POMs should also be valid for CI testing.

release_version="${1:?Expected the release version as the first argument}"

for pom in pom.xml thegreeklab-core/pom.xml; do
sed -i "s#<revision>[^<]*</revision>#<revision>$release_version</revision>#" "$pom"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ LOW RISK

Suggestion: The sed -i command is non-portable and will fail on macOS. Use a temporary file to ensure compatibility across development environments.

Suggested change
sed -i "s#<revision>[^<]*</revision>#<revision>$release_version</revision>#" "$pom"
sed "s#<revision>[^<]*</revision>#<revision>$release_version</revision>#" "$pom" > "$pom.tmp" && mv "$pom.tmp" "$pom"

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.

1 participant