Skip to content

Add CI check for API since annotation version on branches >= 24 - #14196

Open
Pearl1594 wants to merge 1 commit into
mainfrom
ci-param-cs-version
Open

Pearl1594 wants to merge 1 commit into
mainfrom
ci-param-cs-version

Conversation

@Pearl1594

Copy link
Copy Markdown
Contributor

Description

This PR addresses: #14041 (comment)

It checks the following:

  • a new field, with since = "4.24" - Flagged
  • a new field, with since = "24.0" - Pass
  • a new field, no since - Flagged
  • editing description on an existing field that never had since - No op
  • brand-new @APICommand class with no since - Flagged
  • editing an existing @APICommand's description - No op

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@boring-cyborg boring-cyborg Bot added component:integration Python Warning... Python code Ahead! labels Sep 17, 2026
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.93%. Comparing base (27722a5) to head (bd9d98b).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14196      +/-   ##
============================================
+ Coverage     19.91%   19.93%   +0.02%     
- Complexity    20175    20217      +42     
============================================
  Files          6372     6373       +1     
  Lines        577139   577390     +251     
  Branches      70682    70730      +48     
============================================
+ Hits         114913   115085     +172     
- Misses       449664   449735      +71     
- Partials      12562    12570       +8     
Flag Coverage Δ
uitests 3.71% <ø> (ø)
unittests 21.20% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Pearl1594
Pearl1594 requested a review from shwstppr September 17, 2026 19:22
@Pearl1594 Pearl1594 added this to the 24.0 milestone Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 24.83%
Branch coverage 19.05%

Grade Scale

Grade Line Coverage Meaning
🟢 A ≥ 80% Excellent - this code sleeps well at night 😴
🟡 B 60-79% Good - almost there, don't stop now 😉
🟠 C 40-59% Acceptable - your code is wearing a seatbelt, but no airbags 😬
🔴 D 20-39% Marginal - boldly shipping where no test has gone before 🖖
⛔ F < 20% Failing - tests? what tests? 🔥

Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run

@nvazquez
nvazquez marked this pull request as ready for review September 18, 2026 14:24
Copilot AI lite review requested due to automatic review settings September 18, 2026 14:24
@nvazquez nvazquez closed this Sep 18, 2026
@nvazquez nvazquez reopened this Sep 18, 2026

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

🟡 Changes recommended

The checker currently won’t scan Java files outside the repo root and can miss common @Parameter fields with default initializers, undermining the CI check’s intended coverage.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds a GitHub Actions CI check to enforce correct since usage for newly added @APICommand/@Parameter/@Param annotations on branches using the post-4.x version scheme (major >= 24), to prevent accidental since="4.xx" usage and to require since on brand-new API surface.

Changes:

  • Introduces a new workflow that runs on PRs touching **/*.java and executes a repository script.
  • Adds a Python script that diffs PR base/head commits and flags (a) newly added since="4.*" and (b) brand-new annotations missing since.
File summaries
File Description
.github/workflows/check-since-annotation.yml Adds a PR workflow to run the “since annotation” validation on Java changes.
.github/scripts/check_since_annotations.py Implements diff-based detection of old-scheme since values and missing since on newly introduced API annotations.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

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

Comment on lines +45 to +47
VERSION_RE = re.compile(r"<artifactId>cloudstack</artifactId>\s*<version>([^<]+)</version>")
FIELD_DECL_RE = re.compile(r"^\s*(?:private|protected|public)\b[^=;(){}]*?(\w+)\s*;\s*$")
CLASS_DECL_RE = re.compile(r"^\s*(?:public\s+)?(?:final\s+)?class\s+(\w+)")
Comment on lines +66 to +72
def git_diff(base: str, head: str) -> str:
return subprocess.run(
["git", "diff", "--no-color", "--unified=0", base, head, "--", "*.java"],
check=True,
capture_output=True,
text=True,
).stdout
@nvazquez

Copy link
Copy Markdown
Contributor

Thanks @Pearl1594 I'm largely fine with the changes - please check if the Copilot comments are relevant. I have closed/reopened the PR to trigger new CI jobs

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

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

Labels

component:integration Python Warning... Python code Ahead!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants