Skip to content

chore: refactor spam labels #2151

Merged
manishdait merged 1 commit into
hiero-ledger:mainfrom
Gitjay11:Refactor-spam-label
Apr 20, 2026
Merged

chore: refactor spam labels #2151
manishdait merged 1 commit into
hiero-ledger:mainfrom
Gitjay11:Refactor-spam-label

Conversation

@Gitjay11

Copy link
Copy Markdown
Contributor

Description:
Refactor the GitHub spam list automation script to use the newly standardized label names for spam tracking and issue creation. To make future renaming effortless, the label strings have been extracted into central constants at the top of the module.

  • Add LABEL_SPAM and LABEL_SPAM_LIST_UPDATE constants to the spam list updater script
  • Change search queries querying the spam label to query "notes: spam" with proper syntax quoting
  • Change the default issue-tracking label from spam-list-update to notes: spam-list-update
  • Update module documentation to clearly specify how to rename these labels in the future

Related issue(s):

Fixes #2129

Notes for reviewer:
N/A - This is an internal CI/automation script refactor. The search query string syntax was specifically verified to properly handle the spaces inside notes: spam during graph queries.

Checklist

  • Documented (Code comments)

@Gitjay11
Gitjay11 requested review from a team as code owners April 16, 2026 06:07
@codacy-production

codacy-production Bot commented Apr 16, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

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

@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Added constants LABEL_SPAM and LABEL_SPAM_LIST_UPDATE to the spam list automation script, replacing hardcoded label name strings with centralized constant definitions for improved maintainability.

Changes

Cohort / File(s) Summary
Label Constants Refactoring
.github/scripts/cron-admin-update-spam-list.js
Introduced two constants for label names and updated all references throughout the script to use these constants instead of hardcoded strings, enabling easier future label name modifications.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR partially addresses issue #2129 by adding constants and updating labels in one file, but does not appear to have comprehensively searched and updated all occurrences of old labels across workflows and scripts as required. Ensure all instances of 'Spam' and 'spam-list-update' labels are identified and updated across all .github workflows and related scripts, not just the cron-admin-update-spam-list.js file.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: refactor spam labels' accurately summarizes the main change of centralizing and updating spam-related label constants in the automation script.
Description check ✅ Passed The description clearly explains the refactoring objectives, the constants added, label name changes, and future maintainability improvements, all directly related to the changeset.
Out of Scope Changes check ✅ Passed All changes in the PR are directly related to refactoring spam labels and centralizing label constants as specified in issue #2129, with no extraneous modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #2129

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/scripts/update-spam-list.js (1)

219-232: 🛠️ Refactor suggestion | 🟠 Major

Promote 'automated' label to a top-level constant.

One label value is still hardcoded in the changed path; keep all label config centralized.

♻️ Proposed refactor
 const LABEL_SPAM = 'notes: spam';
 const LABEL_SPAM_LIST_UPDATE = 'notes: spam-list-update';
+const LABEL_AUTOMATED = 'automated';
@@
-          labels: [LABEL_SPAM_LIST_UPDATE, 'automated']
+          labels: [LABEL_SPAM_LIST_UPDATE, LABEL_AUTOMATED]

As per coding guidelines, "Use top-level constants for configuration — avoid hardcoded values scattered through the script."


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6d43ad67-78b6-4a61-a688-04af1105ba6c

📥 Commits

Reviewing files that changed from the base of the PR and between 245133d and 5ef0350.

📒 Files selected for processing (1)
  • .github/scripts/update-spam-list.js

@Gitjay11
Gitjay11 force-pushed the Refactor-spam-label branch from 5ef0350 to 1526f29 Compare April 16, 2026 06:24
exploreriii
exploreriii previously approved these changes Apr 16, 2026

@exploreriii exploreriii 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.

Great work!

@exploreriii exploreriii added step: 2nd second stage of the review approval process reviewer: write requires a review with write permissions labels Apr 16, 2026
@github-actions github-actions Bot added skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues notes: extra care requires extra attention to detail or requirements scope: CI/CD involves continuous integration or delivery labels Apr 16, 2026
manishdait
manishdait previously approved these changes Apr 16, 2026
@exploreriii

Copy link
Copy Markdown
Contributor

Rebase please @Gitjay11 or hit update branch

@exploreriii exploreriii added step: merge ready PR is ready and waiting to merge status: update branch developer needs to click update branch and removed notes: extra care requires extra attention to detail or requirements step: 2nd second stage of the review approval process reviewer: write requires a review with write permissions labels Apr 16, 2026
@Gitjay11
Gitjay11 force-pushed the Refactor-spam-label branch from 1526f29 to f13609b Compare April 16, 2026 23:45
@Gitjay11

Copy link
Copy Markdown
Contributor Author

@exploreriii I did it now.

@manishdait

Copy link
Copy Markdown
Contributor

Hi @Gitjay11, please update the branch

@github-actions github-actions Bot added the notes: extra care requires extra attention to detail or requirements label Apr 20, 2026
Signed-off-by: Ajay Rajera <newajay.11r@gmail.com>
@Gitjay11
Gitjay11 force-pushed the Refactor-spam-label branch from f13609b to 4d6b924 Compare April 20, 2026 13:33
@Gitjay11

Copy link
Copy Markdown
Contributor Author

Hi @Gitjay11, please update the branch

@manishdait I did it again

@coderabbitai coderabbitai Bot 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.

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)

1-8: ⚠️ Potential issue | 🟡 Minor

Update the module docstring to reflect the renamed label.

Line 5 still references the old 'spam' label. Since this PR standardizes on notes: spam, update the header comment accordingly to stay consistent with the new constants and the issue #2129 intent.

📝 Proposed doc tweak
- * - Identifies spam users from closed unmerged PRs with 'spam' label
+ * - Identifies spam users from closed unmerged PRs with the 'notes: spam' label

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 060ea822-edcc-4665-ad58-22b9492424a8

📥 Commits

Reviewing files that changed from the base of the PR and between 5ef0350 and 4d6b924.

📒 Files selected for processing (1)
  • .github/scripts/cron-admin-update-spam-list.js

@manishdait
manishdait merged commit 4cf8bee into hiero-ledger:main Apr 20, 2026
11 checks passed
Abhijeet2409 pushed a commit to Abhijeet2409/hiero-sdk-python that referenced this pull request Apr 22, 2026
Signed-off-by: Ajay Rajera <newajay.11r@gmail.com>
AntonioCeppellini pushed a commit to AntonioCeppellini/hiero-sdk-python that referenced this pull request Apr 22, 2026
Signed-off-by: Ajay Rajera <newajay.11r@gmail.com>
parvninama pushed a commit to parvninama/hiero-sdk-python that referenced this pull request Apr 25, 2026
Signed-off-by: Ajay Rajera <newajay.11r@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes: extra care requires extra attention to detail or requirements scope: CI/CD involves continuous integration or delivery skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues status: update branch developer needs to click update branch step: merge ready PR is ready and waiting to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor spam label

4 participants