[release-1.9-post-cqa] [RHIDP-12950]: Rewrite CQA scripts from bash to Node.js ESM#1997
Merged
Conversation
Replace 21 bash CQA scripts with a modular Node.js ESM system at build/scripts/cqa/. Key improvements: - 19 checks as ES modules with shared Checker base class - Single Vale invocation in --all mode (3m31s -> 22s, ~10x speedup) - Vale-based detection for CQA-01, CQA-12, CQA-16 with result caching - Rename DeveloperHub.Attributes to DeveloperHub.ProductNames - Add .vale-product-names.ini for CQA-16 dedicated Vale config - Deduplication of shared module issues across titles - --help flag with full usage documentation - --all report sorted alphabetically by check ID - collectTitle() memoization eliminates redundant include-tree walks - Claude Code plugin (project-cqa) with 21 skills and 9 resources - Update CI workflow for Node.js + Vale Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ibute
Add subs="+attributes,+quotes" to listing/literal code blocks when CQA-16
fix replaces hardcoded product names with attributes inside them. Filter
out false positives on comment and attribute definition lines. Add
{product-cli} attribute for rhdh-cli and fix content using it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Vale and autofix detection for {product-very-short} Local (propose
{product-local-very-short}) and {product-very-short}-cli (propose
{product-cli}). Fix all content occurrences.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace execSync with execFileSync to prevent command injection (S4721) - Tighten regexes to prevent super-linear backtracking (S5852) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The blanket replaceAll('{{', '{') collapsed legitimate {{inherit}}
placeholders in YAML code blocks. Restrict the cleanup to only collapse
double braces around known attribute references (e.g., {{product-very-short}}
→ {product-very-short}), leaving {{inherit}} and similar patterns intact.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Re-run CQA-16 autofix after the double-brace regex correction. The RHDH
to {product-very-short} replacement in identifiers is now applied without
corrupting Helm template {{ .Values }} expressions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Re-run CQA-16 autofix on troubleshoot module after the double-brace
regex correction to preserve Helm {{ .Release.Name }} expressions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused imports (S1128): isInBlock, basename - Reduce cognitive complexity (S3776): extract helpers in cqa-00a, cqa-00b, cqa-01, cqa-12, cqa-14, cqa-16, index.js - Use String#startsWith/endsWith (S6557): cqa-01, cqa-10 - Use optional chaining (S6582): cqa-10 - Use RegExp.exec() (S6594): cqa-14 - Use .includes() instead of .some() (S7765): cqa-02/03/04/05/13 - Use .indexOf() instead of .findIndex() (S7753): cqa-08/09/11 - Use String.raw (S7780): cqa-12 - Prefer replaceAll (S7781): cqa-09 - Combine push() calls (S7778): cqa-02, cqa-13 - Fix negated conditions (S7735): cqa-00b, cqa-05, index, output - Use Boolean directly (S7770): cqa-15 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The autofix now recognizes both +attributes and attributes+ forms when checking if a code block already has attribute substitution enabled, preventing duplicate subs like subs="attributes+,+attributes". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Kubernetes CR kind field should use {product-custom-resource-type}
not {backstage}. Add context-aware pre-replacement in the autofix and
fix 6 occurrences across 5 files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The regex-based double-brace cleanup was still too broad, matching
{{inherit}} and other non-attribute patterns. Replace with explicit
per-attribute cleanup using INSERTED_ATTRS set derived from PATTERNS.
Restore {{inherit}} in orchestrator config and fix missing }} in
LDAP JSON patch command.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace regex-based include path extraction with indexOf, and replace dynamic RegExp pattern matching with string-segment glob matching to eliminate super-linear backtracking risk. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add lib/bin.js that resolves git, vale, sed to absolute paths via `which` at startup. All execFileSync calls now use the resolved paths instead of bare binary names. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously the workflow only created a new comment when changed files were found. Now it always creates or updates the comment, consistent with other PR workflows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
|
990016b
into
redhat-developer:release-1.9-post-cqa
7 of 9 checks passed
Collaborator
Shellcheck Analysis ResultsNo shell scripts were changed in this PR. Automated shellcheck analysis • See shellcheck.net for details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This is an automated cherry-pick of #1989
/assign themr0c