Docs/Rules/Quality (Q01-Q35)

Quality Rules (Q01-Q35)

35 rules for pipeline quality and reliability. Deducts from the Quality Score.

Versioning & Reproducibility (Q01-Q05)

IDSevPtsDescriptionFix
Q01HIGH3Docker image without version tagPin image version: image: node:20-alpine
Q02MED3Service image using :latest tagPin service versions: postgres:15-alpine
Q03MED2Using ubuntu-latest in GitHub ActionsPin runner: runs-on: ubuntu-22.04
Q04MED2GitHub Action using @main or @masterPin to specific version: uses: actions/checkout@v4
Q05MED3No caching configured for dependenciesAdd dependency caching for your package manager

Job Dependencies & Flow (Q06-Q10)

IDSevPtsDescriptionFix
Q06MED3No job dependency chain definedAdd needs: [job_name] for proper dependency chains
Q07MED2Artifacts without expire_in or retentionAdd expire_in: 1 week to artifacts section
Q08LOW2No retry configuration for flaky stepsAdd retry: 2 on jobs with external dependencies
Q09MED3Using deprecated only/except syntaxReplace only/except with rules: syntax
Q10MED2Using deprecated set-output in GitHub ActionsReplace with echo "key=value" >> $GITHUB_OUTPUT

Performance & Optimization (Q11-Q15)

IDSevPtsDescriptionFix
Q11MED3No interruptible flag on non-critical jobsAdd interruptible: true on build and test jobs
Q12MED2No concurrency control in GitHub ActionsAdd concurrency group with cancel-in-progress: true
Q13MED3No resource group for deployment jobsAdd resource_group: production on deploy jobs
Q14LOW2No parallel execution configuredUse parallel: or matrix strategy for test splitting
Q15LOW2Pipeline exceeds 15 stagesConsolidate stages - aim for 5-8 maximum

DRY & Maintainability (Q16-Q20)

IDSevPtsDescriptionFix
Q16MED3No template/extends usage for DRYUse extends: .template or YAML anchors
Q17MED2Script block exceeds 10 linesExtract long scripts to .sh files
Q18MED2Hardcoded URLs or IPs in pipelineUse CI/CD variables: $DEPLOY_URL
Q19HIGH3Script without proper error handlingAdd set -eo pipefail at start of scripts
Q20MED2No runner/tag specificationAdd tags: [docker] or runs-on: to specify runner

Cleanup & Lifecycle (Q21-Q25)

IDSevPtsDescriptionFix
Q21MED2No after_script or post-job cleanupAdd after_script: to clean up temp files
Q22MED3allow_failure on critical security jobsSet allow_failure: false on all security jobs
Q23MED2No test coverage reporting in pipelineAdd coverage reporting to test stage
Q24LOW2Echo or print of environment secretsRemove echo/print referencing secret variables
Q25MED2No variable scoping (global variables everywhere)Move variables to job-level scope where possible

Triggers & Workflow Control (Q26-Q30)

IDSevPtsDescriptionFix
Q26MED3No path-based trigger filteringAdd path filters: only build when src/ changes
Q27MED3Per-job timeout not configuredAdd timeout per job: 10 min for scans, 30 for builds
Q28LOW2Artifacts with overly broad pathsBe specific: artifacts: paths: ["dist/", "reports/"]
Q29MED3No YAML anchors or extends for duplicated configUse .template: + extends: .template for shared config
Q30MED3Manual trigger on non-deploy stagesRemove when: manual from non-production stages

Advanced Quality (Q31-Q35)

IDSevPtsDescriptionFix
Q31LOW2No pipeline duration monitoringTrack duration and alert if exceeding 30 minutes
Q32HIGH4Docker-in-Docker without TLS or pinned versionUse docker:24.0-dind with DOCKER_TLS_CERTDIR
Q33MED3No YAML validation or linting in pipelineAdd yamllint or actionlint as pre-commit hook
Q34MED3No notification on pipeline status changeAdd notification on status changes
Q35MED2No rootless container build alternativeConsider Kaniko or Buildah for rootless builds
Total: 35 rules across 7 sections. All deduct from the Quality Score.