Skip to content

fix(build): resolve all 4 main branch CI lint failures#365

Open
WilliamBerryiii wants to merge 1 commit intomainfrom
fix/main-ci-lint-failures
Open

fix(build): resolve all 4 main branch CI lint failures#365
WilliamBerryiii wants to merge 1 commit intomainfrom
fix/main-ci-lint-failures

Conversation

@WilliamBerryiii
Copy link
Copy Markdown
Member

Description

Resolved all four failing CI jobs on the main branch — Code Quality Lint (ESLint), Shell Lint (ShellCheck + shfmt), Terraform Lint (TFLint), and AIO Version Validation — across 28 files. Each failure had a distinct root cause: unsupported CLI arguments in workflow files, missing ESLint browser globals, an orphaned temp file causing duplicate exports, implicit TFLint config resolution, and non-standard shell script indentation.

CI Workflow Fixes

The AIO version checker and ShellCheck/TFLint workflows used CLI arguments that had been removed or changed in newer tool versions, causing immediate pipeline failures.

  • Simplified the AIO version checker invocation in security-comprehensive.yml and security-deployment.yml by replacing unsupported --break-build, --output-format json, and --output-path arguments with --error-on-mismatch --verbose
    • Removed the corresponding JSON artifact upload steps that depended on the removed output
  • Removed the --rcfile .shellcheckrc flag from shell-lint.yml that shellcheck no longer accepts as a positional argument
  • Added explicit --config $(pwd)/.tflint.hcl to both tflint --init and tflint --recursive in terraform-lint.yml, fixing config file resolution that failed when run from the repository root

ESLint Configuration and Orphaned File Cleanup

  • Added three missing browser API globals (EventSource, btoa/atob, screen) to eslint.config.js to eliminate undefined-variable errors in browser-targeted source files
  • Deleted docs/assets/js/temp-dashboard-clean.js, a 747-line orphaned temporary LearningPathDashboard class that caused duplicate export declarations and shadowed the functional implementation

ESLint Code Quality Fixes

Applied systematic ESLint auto-fix enforcement across ~40 JavaScript source and test files under docs/. The dominant patterns were:

  • Curly brace enforcement (curly: 'always') on single-statement if/else/return blocks across source and test files
  • Error cause chaining — added { cause: error } to Error constructors in schemas/index.js, progress-operations.js, vitest-setup.js, clear-functionality.test.js, and storage.js
  • Variable declarations — converted let to const where reassignment was absent
  • Dead code removal — removed unused debugLog() method in enhanced-anchor-links.js, unused updatePaths() in cards.js, unused server variable in health.test.js, and unnecessary try-catch wrappers
  • Template literals — replaced string concatenation with template literals in storage.js, docsify-frontmatter-plugin.js, and related files
  • Export consolidation in common-test-utils.js — added inline export to generatePathData() and removed the duplicate named exports block
  • Regex escaping — corrected ([^)\.]+) to ([^).]+) in learning-path-parser.js and interactive-learning-path-checkboxes.js
  • Minor formatting — arrow function conversion, bracket-to-dot notation, comment spacing, blank line removal, whitespace alignment

Shell Script Formatting

  • Reformatted run-contract-tests.sh and run-deployment-tests.sh to 2-space indentation via shfmt
  • Standardized operate-all-terraform.sh from 4-space to 2-space indentation in case statement blocks

Related Issue

Fixes #360

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Blueprint modification or addition
  • Component modification or addition
  • Documentation update
  • CI/CD pipeline change
  • Other (please describe):

Implementation Details

Each CI failure was diagnosed independently by reproducing the lint commands locally:

  1. AIO Version Validation — the aio-version-checker.py script had removed --break-build and --output-format arguments in a prior update, but the workflow files still passed them. Replaced with the current --error-on-mismatch --verbose interface.
  2. Shell Lint — shellcheck treats --rcfile as the file-to-lint argument when placed after --, causing a "file not found" error. Removed the flag; shellcheck auto-discovers .shellcheckrc from the working directory.
  3. Terraform Lint — TFLint's --recursive mode did not resolve .tflint.hcl from the repository root. Adding --config $(pwd)/.tflint.hcl explicitly makes config resolution deterministic.
  4. Code Quality Lint — ran npx eslint --fix across all JavaScript source and test files, added missing browser globals to the ESLint config, and removed the orphaned temp file that caused duplicate exports.

Testing Performed

  • Terraform plan/apply
  • Blueprint deployment test
  • Unit tests
  • Integration tests
  • Bug fix includes regression test (see Test Policy)
  • Manual validation
  • Other:

Validation Steps

  1. Run npx eslint . from the repository root — should report 0 errors (warnings are expected)
  2. Run npm run tflint-fix-all — should complete without config resolution errors
  3. Run shellcheck against any .sh file — should not fail on an --rcfile argument
  4. Verify scripts/aio-version-checker.py --help accepts --error-on-mismatch and --verbose

Checklist

  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have run terraform fmt on all Terraform code
  • I have run terraform validate on all Terraform code
  • I have run az bicep format on all Bicep code
  • I have run az bicep build to validate all Bicep code
  • I have checked for any sensitive data/tokens that should not be committed
  • Lint checks pass (run applicable linters for changed file types)

Security Review

  • No credentials, secrets, or tokens are hardcoded or logged
  • RBAC and identity changes follow least-privilege principles
  • No new network exposure or public endpoints introduced without justification
  • Dependency additions or updates have been reviewed for known vulnerabilities
  • Container image changes use pinned digests or SHA references

Additional Notes

  • No Terraform source files were changed — only the CI workflow that invokes TFLint. The terraform fmt and terraform validate checklist items are not applicable to this PR.
  • No Bicep files were changed — the az bicep format and az bicep build checklist items are not applicable.
  • All ESLint fixes are mechanical auto-fix output with no behavioral changes to application logic.

Screenshots (if applicable)

- fix AIO version checker args in security workflows
- fix ESLint errors: escapes, caught errors, duplicates, assignments, exports
- remove orphaned temp-dashboard-clean.js
- fix shellcheck --rcfile flag and shfmt formatting in test scripts
- fix TFLint --recursive config path resolution

🐛 - Generated by Copilot
@WilliamBerryiii WilliamBerryiii requested a review from a team as a code owner April 8, 2026 02:06
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

📚 Documentation Health Report

Generated on: 2026-04-08 02:19:39 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 235
Infrastructure Components 191
Blueprints 39
Learning Platform 89
GitHub Resources 44
AI Assistant Guides (Copilot) 17
Total 615

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Sidebar Generation: success
  • Link Validation: success
  • Build Test: skipped

This report is automatically generated by the Documentation Automation workflow.

Copy link
Copy Markdown
Collaborator

@katriendg katriendg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this one, I just realized on main build 🙏

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: resolve 4 main branch CI lint failures

3 participants