Repository navigation
Conversation
efe5957 to
bd9d98b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14196 +/- ##
============================================
+ Coverage 19.91% 20.44% +0.53%
- Complexity 20175 21413 +1238
============================================
Files 6372 6487 +115
Lines 577139 589337 +12198
Branches 70682 72248 +1566
============================================
+ Hits 114913 120513 +5600
- Misses 449664 455695 +6031
- Partials 12562 13129 +567
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 25.49% |
| Branch coverage | 19.79% |
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
There was a problem hiding this comment.
🟡 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
**/*.javaand 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 missingsince.
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.
| 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 |
|
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 |
|
|
@DaanHoogland I've addressed one of the comments, I think this is good to merge |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open issues
Parsing the project version via a regex tied to<artifactId>cloudstack</artifactId><version>...… · New Parsing the project version via a regex tied to<artifactId>cloudstack</artifactId><version>...… · New The missing-sincedetection only inspects the next non-blank added line to decide whether the… · New The git diff pathspec "*.java" only matches Java files in the repository root, so this check will…
1 resolved since last review
Review effort: Lite
| def read_project_version(pom_path: str) -> str: | ||
| with open(pom_path, encoding="utf-8") as f: | ||
| content = f.read() | ||
| match = VERSION_RE.search(content) | ||
| if not match: | ||
| raise SystemExit(f"Could not find the cloudstack project version in {pom_path}") | ||
| return match.group(1) |
|
|
||
| ANNOTATION_START_RE = re.compile(r"@(Param|Parameter|APICommand)\s*\(") | ||
| SINCE_RE = re.compile(r'since\s*=\s*"(4\.\d[\w.]*)"') | ||
| HAS_SINCE_RE = re.compile(r"\bsince\s*=") | ||
| 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+)") | ||
|
|
||
|
|
||
| def read_project_version(pom_path: str) -> str: | ||
| with open(pom_path, encoding="utf-8") as f: | ||
| content = f.read() | ||
| match = VERSION_RE.search(content) | ||
| if not match: | ||
| raise SystemExit(f"Could not find the cloudstack project version in {pom_path}") | ||
| return match.group(1) | ||
|
|
||
|
|
| for candidate in remainder.splitlines(): | ||
| candidate = candidate.strip() | ||
| if not candidate: | ||
| continue | ||
| decl_match = decl_re.match(candidate) | ||
| break # only look at the next non-blank added line | ||
|
|
|
|
|
||
|
|
||
| def read_project_version(pom_path: str) -> str: | ||
| with open(pom_path, encoding="utf-8") as f: |
| return subprocess.run( | ||
| ["git", "diff", "--no-color", "--unified=0", base, head, "--", "*.java"], | ||
| check=True, | ||
| capture_output=True, | ||
| text=True, | ||
| ).stdout |









Description
This PR addresses: #14041 (comment)
It checks the following:
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?