refactor: centralize broken-markdown-links and automated labels#2152
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a new labels constants module and updates one workflow and one automation script to import and use those label constants; also adds workflow-level concurrency and tightens payload access in the workflow script. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/cron-check-broken-links.yml (1)
40-44: 🧹 Nitpick | 🔵 TrivialAdd a concurrency guard before this step starts mutating issues.
.github/scripts/report-broken-links.jsdoes a list-then-create check, so an overlapping manual dispatch, scheduled run, or retry can still create duplicate issues before either run sees the other's write. Put this workflow or job behind a fixed concurrency group.As per coding guidelines, "Workflows that mutate state should use concurrency groups and duplicate prevention patterns (marker-based comments, check-before-create for labels)."Suggested workflow change
name: Cron – Check Broken Markdown Links + +concurrency: + group: cron-check-broken-markdown-links + cancel-in-progress: false on: schedule:
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 59bfdf3c-6e92-40d9-935d-ae7eda4eae67
📒 Files selected for processing (4)
.github/scripts/labels.js.github/scripts/report-broken-links.js.github/scripts/update-spam-list.js.github/workflows/cron-check-broken-links.yml
exploreriii
left a comment
There was a problem hiding this comment.
You have two PRs here, the spam and also the broken link one.
Could you please keep each pr a fresh copy from main
Only create the separate js file if you must, ideally there is minimal refactoring, and is as close to the original version as possible in this issue
29197b3 to
d74bcb7
Compare
|
I have done the changes now, it is ready for review. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 52be8f8b-e807-427d-a5a2-d1b23561a74b
📒 Files selected for processing (2)
.github/scripts/labels.js.github/workflows/cron-pr-check-broken-links.yml
aceppaluni
left a comment
There was a problem hiding this comment.
@Gitjay11 Did you test this on your fork?
|
Hey @Gitjay11, thanks for taking this on — you're headed in the right direction! A few things to sort out before this is ready:
Please feel free to ask questions on any of the above tasks! |
|
Hello, this is the OfficeHourBot. This is a reminder that the Hiero Python SDK Office Hours are scheduled in approximately 4 hours (14:00 UTC). This session provides an opportunity to ask questions regarding this Pull Request. Details:
Disclaimer: This is an automated reminder. Please verify the schedule here for any changes. From, |
d74bcb7 to
9598ccb
Compare
@aceppaluni yes i have |
@AgrimTawani Thanks for this, I have done all the changes now. @exploreriii you can review it now. |
|
@Gitjay11 Do you have a link to your test? |
For testing part, i created a new file to test it and it is running properly
|
exploreriii
left a comment
There was a problem hiding this comment.
Hi thanks for your patience, we are trialing making some PRs open to community reviews.
This looks good to me once the names change back again, on to the second round
|
@Gitjay11 Happy to review again once changes are addressed. |
9598ccb to
4250060
Compare
|
Hi @aceppaluni @exploreriii I did the changes, it is ready for review, Thanks. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/scripts/cron-admin-update-spam-list.js (1)
21-22: 🧹 Nitpick | 🔵 TrivialOptional follow-up: centralize the remaining label constants too.
LABEL_SPAMandLABEL_SPAM_LIST_UPDATEare still defined inline here whileLABEL_AUTOMATEDnow lives inlabels.js. This is out of scope for this PR (maintainer narrowed scope tobroken-markdown-linksandautomated), but moving them into.github/scripts/labels.jsin a follow-up would finish the centralization started by issue#2130and keep the single-source-of-truth invariant intact. Not a blocker.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a96bd4b3-2e72-46d8-95dd-14238d6d54c1
📒 Files selected for processing (3)
.github/scripts/cron-admin-update-spam-list.js.github/scripts/labels.js.github/workflows/cron-pr-check-broken-links.yml
|
@Gitjay11, Please update the branch |
…o-ledger#2130) Signed-off-by: Ajay Rajera <newajay.11r@gmail.com>
4250060 to
cb367db
Compare
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
@manishdait I updated the branch. |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/scripts/labels.js (1)
5-6:⚠️ Potential issue | 🔴 CriticalConstant values do not match the labels currently defined in repo settings — breaking change for both consumers.
The earlier
gh label listverification showed the repository's actual labels arebroken-markdown-linksandautomated, notnotes: broken markdown links/notes: automated. With these constants in place:
.github/workflows/cron-pr-check-broken-links.yml(line 56, line 82) will querylistForRepowith labels that do not exist, so the idempotency check will never find an existing open issue and a new issue will be opened on every failing run..github/scripts/cron-admin-update-spam-list.js(line 233) will attempt to attach a non-existentnotes: automatedlabel to the created issue; the GitHub API will either reject the request or silently drop the unknown label depending on permissions, and downstream filters keyed onautomatedwill stop matching.This was also called out by maintainer review feedback on this PR: when centralizing, the constant values must match the labels currently defined in GitHub settings. If the rename to the
notes: …form is intentional, that needs to land as a separate, coordinated change (create the new labels in repo settings, migrate existing tagged issues, then flip the constants).Suggested minimal fix to unblock this PR:
🛠 Restore values to match existing repo labels
-const LABEL_BROKEN_MARKDOWN_LINKS = 'notes: broken markdown links'; -const LABEL_AUTOMATED = 'notes: automated'; +const LABEL_BROKEN_MARKDOWN_LINKS = 'broken-markdown-links'; +const LABEL_AUTOMATED = 'automated';
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 826f54e2-09c8-4361-9084-fbf7382155c0
📒 Files selected for processing (3)
.github/scripts/cron-admin-update-spam-list.js.github/scripts/labels.js.github/workflows/cron-pr-check-broken-links.yml
…o-ledger#2152) Signed-off-by: Ajay Rajera <newajay.11r@gmail.com>

Description:
Centralize the hardcoded workflow labels 'broken-markdown-links' and 'automated' into a shared .github/scripts/labels.js configuration module, and update the cron-pr-check-broken-links.yml workflow to import these constants via require(). This facilitates easier future label updates and maintenance.
Related issue
Fixes #2130
Notes for reviewer
Per maintainer feedback, the scope was narrowed to only centralize the label constants. The existing inline script structure in the workflow is preserved, only the hardcoded label strings were replaced with imports from labels.js.