From 5ab30e135be53a42426c207e82da7f88c9b11268 Mon Sep 17 00:00:00 2001 From: Herbert Damker <52109189+hdamker@users.noreply.github.com> Date: Sat, 24 Oct 2026 06:41:49 +0200 Subject: [PATCH] chore(linting): delete the retired v0 linting workflows, callers and docs --- .github/workflows/pr_validation.yml | 219 ------------------ .github/workflows/spectral-oas.yml | 41 ---- .github/workflows/tooling-ci.yml | 1 - README.md | 2 - linting/README.md | 8 +- linting/config/.gherkin-lintrc | 78 ------- linting/config/.gplintrc | 3 +- linting/docs/Reusable Workflows.md | 98 -------- linting/workflows/pr_validation_caller.yml | 49 ---- linting/workflows/spectral-oas-caller.yml | 42 ---- .../docs/technical-architecture.md | 27 +-- tooling_lib/ci_plan.py | 1 - .../tests/test_rule_metadata_integrity.py | 18 -- 13 files changed, 10 insertions(+), 577 deletions(-) delete mode 100644 .github/workflows/pr_validation.yml delete mode 100644 .github/workflows/spectral-oas.yml delete mode 100644 linting/config/.gherkin-lintrc delete mode 100644 linting/docs/Reusable Workflows.md delete mode 100644 linting/workflows/pr_validation_caller.yml delete mode 100644 linting/workflows/spectral-oas-caller.yml diff --git a/.github/workflows/pr_validation.yml b/.github/workflows/pr_validation.yml deleted file mode 100644 index 15cd1038..00000000 --- a/.github/workflows/pr_validation.yml +++ /dev/null @@ -1,219 +0,0 @@ -# ========================================================================================= -# CAMARA Project - Pull Request Validation Workflow -# -# This GitHub Actions is a reusable workflow for validating PRs using tools configuration -# from subfolder indicated by input `configurations` variable. -# -# Validation includes: -# - release-plan.yaml validation (if changed, must be exclusive - no other changes) -# - MegaLinter for API definitions and test files -# -# CHANGELOG: -# - 2025-08-01: Initial version for v0 -# - 2026-01-13: Added release-plan.yaml validation with exclusivity check -# -# USAGE: -# The action is invoked by Pull Request Validation Workflow Caller in CAMARA API repositories -# -# DOCUMENTATION: -# see https://github.com/camaraproject/tooling/tree/main/linting/docs -# ========================================================================================= - -name: PR validation for CAMARA Project - -on: - workflow_call: - inputs: - configurations: - description: Subfolder containing tool configs to be used - type: string - required: false - default: "" - -jobs: - pr-validation: - name: PR Validation - runs-on: ubuntu-latest - - steps: - - name: Checkout Code - uses: actions/checkout@v7 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 - - - name: Detect changed files - id: changes - uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 - with: - files_yaml: | - release_plan: - - release-plan.yaml - other: - - '**' - - '!release-plan.yaml' - - # ==================== release-plan.yaml Validation ==================== - # If release-plan.yaml changed, it must be the ONLY change in the PR - # This ensures validation errors from rule changes don't mix with code changes - - - name: Check exclusivity - id: exclusivity - if: steps.changes.outputs.release_plan_any_changed == 'true' - run: | - if [[ "${{ steps.changes.outputs.other_any_changed }}" == "true" ]]; then - echo "::error::release-plan.yaml must be changed in a separate PR" - echo "## Exclusivity Check Failed" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "release-plan.yaml changes must be in a **separate PR** from other changes." >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Reason:** If release-plan.yaml changes validation rules (e.g., alpha to rc)," >> $GITHUB_STEP_SUMMARY - echo "any new errors should be clearly attributable to the rule change, not mixed with code changes." >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Please:**" >> $GITHUB_STEP_SUMMARY - echo "1. Remove release-plan.yaml changes from this PR" >> $GITHUB_STEP_SUMMARY - echo "2. Create a separate PR for release-plan.yaml updates" >> $GITHUB_STEP_SUMMARY - exit 1 - fi - - - name: Validate release-plan.yaml - if: steps.changes.outputs.release_plan_any_changed == 'true' - id: validate - uses: camaraproject/tooling/shared-actions/validate-release-plan@v0 - with: - release_plan_path: release-plan.yaml - check_files: 'true' - - - name: release-plan.yaml validation result - if: always() && steps.exclusivity.outcome != 'failure' - uses: actions/github-script@v9 - with: - script: | - const changed = '${{ steps.changes.outputs.release_plan_any_changed }}' === 'true'; - - if (!changed) { - core.notice('release-plan.yaml not modified, validation skipped'); - return; - } - - const valid = '${{ steps.validate.outputs.valid }}' === 'true'; - const runUrl = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'; - - // Parse warnings - const warningsStr = `${{ steps.validate.outputs.warnings }}`; - let warnings = []; - try { - warnings = JSON.parse(warningsStr || '[]'); - } catch (e) { - if (warningsStr && warningsStr.trim()) warnings = [warningsStr]; - } - - // Determine status - let description; - if (!valid) { - description = 'Validation failed'; - } else if (warnings.length > 0) { - description = 'Validation passed with warnings'; - } else { - description = 'Validation passed'; - } - - // Try commit status silently (works on non-fork PRs, silently skipped on fork PRs) - try { - await github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: context.sha, - state: valid ? 'success' : 'failure', - context: '--> Validate: release-plan.yaml', - description: description, - target_url: runUrl - }); - } catch (e) { - // Silently ignore — fork PRs don't have write permissions - } - - if (!valid) { - const errorsStr = `${{ steps.validate.outputs.errors }}`; - let errors = []; - try { - errors = JSON.parse(errorsStr || '[]'); - } catch (e) { - errors = [errorsStr]; - } - for (const err of errors) { - core.error(err, {file: 'release-plan.yaml'}); - } - core.summary.addHeading('Release Plan Validation Failed', 2); - core.summary.addList(errors); - await core.summary.write(); - core.setFailed('Release plan validation failed'); - } else { - if (warnings.length > 0) { - for (const warn of warnings) { - core.warning(warn, {file: 'release-plan.yaml'}); - } - core.summary.addHeading('Release Plan Validation Passed with Warnings', 2); - core.summary.addList(warnings); - } else { - core.notice('release-plan.yaml validation passed'); - core.summary.addHeading('Release Plan Validation Passed', 2); - } - await core.summary.write(); - } - - # ==================== MegaLinter ==================== - # Runs when: - # - release-plan.yaml was NOT changed, OR - # - release-plan.yaml was changed AND validation passed - # Skipped when release-plan.yaml validation fails (no point linting with invalid rules) - - - name: Checkout linting config - if: steps.changes.outputs.release_plan_any_changed != 'true' || steps.validate.outputs.valid == 'true' - uses: actions/checkout@v7 - with: - repository: camaraproject/tooling - path: lint-config - # using configurations from v0 floating tag - ref: v0 - sparse-checkout: | - linting/config/ - sparse-checkout-cone-mode: false - - - name: Copy config to workspace - if: steps.changes.outputs.release_plan_any_changed != 'true' || steps.validate.outputs.valid == 'true' - # --strip-trailing-slashes removes any trailing slashes from each SOURCE argument (when ${{ inputs.configurations }} is empty) - run: cp -RT --strip-trailing-slashes ${{ github.workspace }}/lint-config/linting/config/${{ inputs.configurations }} ${{ github.workspace }} - - - name: MegaLinter - id: ml - if: steps.changes.outputs.release_plan_any_changed != 'true' || steps.validate.outputs.valid == 'true' - # You can override MegaLinter flavor used to have faster performances - # c_cpp MegaLinter Flavor https://megalinter.io/latest/flavors/c_cpp/ includes all needed linters - can be upgraded to v8 - uses: oxsecurity/megalinter/flavors/c_cpp@v7 - # configuration of Megalinter - env: - VALIDATE_ALL_CODEBASE: true - PRINT_ALPACA: false - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_COMMENT_REPORTER: true - GITHUB_STATUS_REPORTER: true - DISABLE: COPYPASTE,SPELL,JAVASCRIPT,MARKDOWN - # OPENAPI_SPECTRAL is deprecated but still present in Megalinter v7 - DISABLE_LINTERS: OPENAPI_SPECTRAL,YAML_PRETTIER,REPOSITORY_GRYPE,REPOSITORY_SEMGREP,REPOSITORY_DEVSKIM,REPOSITORY_KICS,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,REPOSITORY_CHECKOV,REPOSITORY_GITLEAKS,YAML_V8R,JAVA_PMD - API_SPECTRAL_CONFIG_FILE: .spectral.yaml - YAML_YAMLLINT_CONFIG_FILE: .yamllint.yaml - GHERKIN_GHERKIN_LINT_CONFIG_FILE: .gherkin-lintrc - API_SPECTRAL_FILTER_REGEX_INCLUDE: (code/API_definitions/) - YAML_YAMLLINT_FILTER_REGEX_INCLUDE: (code/API_definitions/) - GHERKIN_GHERKIN_LINT_FILTER_REGEX_INCLUDE: (code/Test_definitions/) - - - name: Archive reports - if: (success() || failure()) && steps.ml.outcome != 'skipped' - uses: actions/upload-artifact@v7 - with: - name: MegaLinter reports - include-hidden-files: "true" - path: | - megalinter-reports - mega-linter.log diff --git a/.github/workflows/spectral-oas.yml b/.github/workflows/spectral-oas.yml deleted file mode 100644 index 703a6661..00000000 --- a/.github/workflows/spectral-oas.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Execute Spectral with CAMARA ruleset -# A reusable action for validating PRs using tools configuration from branch indicated by input `configurations` variable -# CAMARA Project - Github Action -# initial version - -on: - workflow_call: - # For a workflow to be reusable, the values for on must include workflow_call - inputs: - configurations: - description: The branch, tag, or commit to check out - containing tool configs to be used - type: string - required: false - default: main -jobs: - execute: - name: Spectral - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v7 - with: - token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} - - name: Checkout linting config - uses: actions/checkout@v7 - with: - repository: camaraproject/tooling - path: lint-config - ref: ${{ inputs.configurations }} - sparse-checkout: | - linting/config/ - sparse-checkout-cone-mode: false - - name: Copy specified folder to workspace root - run: cp -RT ${{ github.workspace }}/lint-config/linting/config ${{ github.workspace }} - - name: Install Spectral - run: npm install -g @stoplight/spectral - - name: Install Spectral functions - run: npm install -g @stoplight/spectral-functions - - name: Run Spectral linting - run: spectral lint code/API_definitions/*.yaml --verbose --ruleset ${{ github.workspace }}/.spectral.yaml - diff --git a/.github/workflows/tooling-ci.yml b/.github/workflows/tooling-ci.yml index b367b770..6dd803fc 100644 --- a/.github/workflows/tooling-ci.yml +++ b/.github/workflows/tooling-ci.yml @@ -128,7 +128,6 @@ jobs: .github/workflows \ validation/workflows \ release_automation/workflows \ - linting/workflows \ -maxdepth 1 \ -type f \ -name '*.yml' \ diff --git a/README.md b/README.md index f41b2c02..f728df34 100644 --- a/README.md +++ b/README.md @@ -83,10 +83,8 @@ tooling/ ├── .github/ │ ├── ISSUE_TEMPLATE/ │ └── workflows/ # Reusable workflows (public interface) -│ ├── pr_validation.yml # retired v0 linting │ ├── release-automation-regression.yml │ ├── release-automation-reusable.yml -│ ├── spectral-oas.yml # retired v0 linting │ ├── update-floating-tag.yml │ ├── validation-regression.yml │ ├── validation-settings-ci.yml diff --git a/linting/README.md b/linting/README.md index c989dd06..56fcd2de 100644 --- a/linting/README.md +++ b/linting/README.md @@ -2,16 +2,10 @@ ## `linting` Folder Content -Caller workflows are stored in [workflows](/linting/workflows) folder. - Configuration files are in [config](/linting/config) folder. -Documentation for linting workflows is in [docs](/linting/docs) folder. - ``` tooling/ └── linting/ - ├── workflows/ # Caller workflows that use reusable workflows - ├── config/ # Configuration files for linting tools - └── docs/ # Documentation for linting workflows + └── config/ # Configuration files for linting tools ``` diff --git a/linting/config/.gherkin-lintrc b/linting/config/.gherkin-lintrc deleted file mode 100644 index 9bd2724b..00000000 --- a/linting/config/.gherkin-lintrc +++ /dev/null @@ -1,78 +0,0 @@ -// DEPRECATED: legacy v0 validation only. -// This file is consumed by MegaLinter's gherkin-lint integration in -// .github/workflows/pr_validation.yml. Do not use it for CAMARA Validation v1. -// Remove it together with the v0 validation workflow. -{ - "no-files-without-scenarios" : "on", - "no-unnamed-features": "on", - "no-unnamed-scenarios": "on", - "no-dupe-scenario-names": ["on", "in-feature"], - "no-dupe-feature-names": "on", - "no-partially-commented-tag-lines": "on", - "indentation" : [ - "on", { - "Feature": 0, - "Background": 2, - "Scenario": 2, - "Step": 2, - "Examples": 4, - "example": 6, - "given": 4, - "when": 4, - "then": 4, - "and": 4, - "but": 4, - "feature tag": 2, - "scenario tag": 2 - } - ], - "no-trailing-spaces": "on", - "new-line-at-eof": ["off", "yes"], - "no-multiple-empty-lines": "on", - "no-empty-file": "on", - "no-scenario-outlines-without-examples": "on", - "name-length": ["on", {"Feature": 250, "Step": 250, "Scenario": 250}], - "no-restricted-tags": ["on", {"tags": ["@watch", "@wip"]}], - "use-and": "on", - "keywords-in-logical-order": "on", - "no-duplicate-tags": "on", - "no-superfluous-tags": "on", - "no-homogenous-tags": "on", - "one-space-between-tags": "on", - "no-unused-variables": "on", - "no-background-only-scenario": "on", - "no-empty-background": "on", - "scenario-size": ["off", { "steps-length": {"Background": 15, "Scenario": 15}}], - "only-one-when": "off", - "allowed-tags": ["on", { - "patterns": [ - "^@watch$", - "^@wip$", - "^@.*$" - ] - }], - "file-name": ["off", {"style": "kebab-case"}], - "max-scenarios-per-file": ["on", {"maxScenarios": 50, "countOutlineExamples": false}], - "no-restricted-patterns": ["off", { - "Global": [ - "^globally restricted pattern" - ], - "Feature": [ - "poor description", - "validate", - "verify" - ], - "Background": [ - "show last response", - "a debugging step" - ], - "Scenario": [ - "show last response", - "a debugging step" - ] - }], - "required-tags": ["on", { - "tags": ["^@.*$"], // Allow any tag starting with '@' - "ignoreUntagged": false // Enforce tagging -}] -} diff --git a/linting/config/.gplintrc b/linting/config/.gplintrc index 92fd9f3f..69edecba 100644 --- a/linting/config/.gplintrc +++ b/linting/config/.gplintrc @@ -1,6 +1,5 @@ // CAMARA Validation v1 GPLint configuration. -// GPLint's default config file name is .gplintrc. Keep this separate from the -// legacy .gherkin-lintrc used by v0/MegaLinter's gherkin-lint integration. +// GPLint's default config file name is .gplintrc. // Rule levels stay at warn; CAMARA severity is assigned by validation metadata. { "no-files-without-scenarios" : "warn", diff --git a/linting/docs/Reusable Workflows.md b/linting/docs/Reusable Workflows.md deleted file mode 100644 index d205a447..00000000 --- a/linting/docs/Reusable Workflows.md +++ /dev/null @@ -1,98 +0,0 @@ -# Reusable Workflows Implementation Guide - -## Overview - -This guide focuses on implementing caller workflows in CAMARA API repositories that utilize reusable liniting workflows from the `tooling` repository. -For comprehensive information about reusable workflows, refer to the official GitHub documentation: [Reusing workflows](https://docs.github.com/en/actions/sharing-automations/reusing-workflows). - - -## `tooling` Repository Structure - -All files needed for implementation are stored in `tooling` repository. -``` -tooling/ -├── .github/workflows/ # Standard GitHub workflows location -├── linting/ -│ ├── workflows/ # Caller workflows that use reusable workflows -│ ├── config/ # Configuration files for linting tools -│ └── docs/ # Documentation for linting workflows -└── ... # other tools - -``` - -### Reusable Workflows in `tooling` Repository - -Reusable workflows are stored in the `tooling` repository under `.github/workflows/`. - -Currenly definded workflows: - -- **pr_validation.yml** - workflow to check the PR is related to API definition (OpenAPI specification, Gherkin test definitions) using Megalinter -[Megalinter](https://megalinter.io) is a comprehensive linting tool designed to analyze and improve code quality across multiple programming languages and file types. -Megalinter combines dozens of popular linters into a single tool, allowing to check code quality, formatting, security issues, and best practices across an entire repository. -Additional checks can be performed for Release PRs (tbd). - -- **spectral-oas.yml** - workflow to manually trigger [Spectral](https://meta.stoplight.io/docs/spectral) linter for OpenAPI with CAMARA ruleset. -Manual run of this workflow produces more detailed output compared to results presented by Megalinter. - -### Workflow configuration files in `linting` folder - -Configuration files in `/linting/config/`: -- **.gherkin-lintrc** - deprecated v0-only ruleset for the [gherkin-lint](https://github.com/vsiakka/gherkin-lint) tool used by MegaLinter in `pr_validation.yml` -- **.gplintrc** - ruleset for the [GPLint](https://github.com/gplint/gplint) tool used by CAMARA Validation v1 -- **.spectral.yaml** - CAMARA rulest for [Spectral](https://meta.stoplight.io/docs/spectral) linter -- **.yamllint.yml** - ruleset for [yamllint](https://yamllint.readthedocs.io/en/stable/index.html) tool - -The legacy v0 linting rulesets originated from [Commonalities/artifacts](https://github.com/camaraproject/Commonalities/tree/main/artifacts/linting_rules). The GPLint ruleset is maintained separately in `tooling` because GPLint uses a different configuration schema from `gherkin-lint`. - - -### Caller Workflows in `linting` folder -Caller workflows are stored in `/linting/workflows/`. - -Currenly definded workflows: -- **pr_validation_caller.yml** - caller for PR validation workflow -- **spectral-oas-caller.yml** - caller for Spectral linter with CAMARA ruleset - - - -## Setting Up Linting Workflows - -### API Repository Structure - -``` -API-repository/ -├── .github/workflows/ # Standard GitHub workflows location -├── code -├── documentation -├── ... - -``` - -### Deployment of Caller Workflows - -Caller workflows need to be placed in the `.github/workflows` folder of the API repository. This is the **only** required action. - -``` -API-repository/ -├── .github/workflows/ - ├── pr_validation_caller.yml - └── spectral-oas-caller.yml -``` - -The job input parameter `configurations` in caller workflows allows to specify the branch of the `tooling` repository from which the configuration files stored in `/linting/config/` are applied in the reusable workflows. -By default, the main branch of tooling is used. - -```yaml -# with: -# configurations: staging -``` -This way custom configurations can be used (if needed by given repository or for canary deployment of new configurations) - first the relevant branch needs to be created in the `tooling` repository. - -## Runnig Linting Workflows - -### PR validation -This workflow is triggered for each Pull Request in the API Repository. -Additional job (to be defined) is executed for PRs modifying CHANGELOG.md file (like Release PRs). - - -### Manual execution of Spectral linting with CAMARA ruleset -This workflow can be triggered manually (on `workflow_dispatch') from Actions menu of Github repository. diff --git a/linting/workflows/pr_validation_caller.yml b/linting/workflows/pr_validation_caller.yml deleted file mode 100644 index d847f6e0..00000000 --- a/linting/workflows/pr_validation_caller.yml +++ /dev/null @@ -1,49 +0,0 @@ -# ========================================================================================= -# CAMARA Project - Pull Request Validation Workflow Caller -# -# This GitHub Actions workflow is responsible for invoking a reusable PR validation workflow -# from the camaraproject/tooling repository. It is intended to ensure consistent validation -# steps for all PRs targeting the main branch in this repository. -# -# CHANGELOG: -# - 2025-08-01: Initial version for v0 -# -# USAGE: -# - Automatically triggers on pull requests targeting main. -# - Can be triggered manually via workflow_dispatch. -# - Calls by default the reusable workflow at -# camaraproject/tooling/.github/workflows/pr_validation.yml@v0 -# -# DOCUMENTATION: -# see https://github.com/camaraproject/tooling/tree/main/linting/docs -# ========================================================================================= - -name: Caller for PR validation workflow - -on: - # Trigger on pull requests to the main branch only - pull_request: - branches: main - # Enable manual trigger via the GitHub UI - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true - -permissions: - # Grant necessary write permissions for PRs, contents, and issues - pull-requests: write - contents: write - issues: write - statuses: write - -jobs: - pr_validation: - # Invoke the reusable PR validation workflow from "v0" tag of camaraproject/tooling - uses: camaraproject/tooling/.github/workflows/pr_validation.yml@v0 - secrets: inherit -# Tools configuration from the tooling repository subfolder of /linting/config/ indicated by `configurations` variable -# If needed, you can specify a configuration from another subfolder of camaraproject/tooling/linting/config/ (uncomment below) -# with: -# configurations: api-name diff --git a/linting/workflows/spectral-oas-caller.yml b/linting/workflows/spectral-oas-caller.yml deleted file mode 100644 index 05cde3fa..00000000 --- a/linting/workflows/spectral-oas-caller.yml +++ /dev/null @@ -1,42 +0,0 @@ -# ========================================================================================= -# CAMARA Project - Linting OpenAPI Specification with CAMARA Ruleset Caller -# -# This GitHub Actions workflow is responsible for invoking a reusable "Spectral linting with -# CAMARA ruleset" workflow from the camaraproject/tooling repository. It is intended to -# provide more detailed output from Spectral tool (warnings, hints) -# -# CHANGELOG: -# - 2025-08-01: Initial version for v0 -# -# USAGE: -# - Can be triggered manually via workflow_dispatch. -# - Calls by default the reusable workflow at -# camaraproject/tooling/.github/workflows/spectral-oas.yml@v0 -# -# DOCUMENTATION: -# see https://github.com/camaraproject/tooling/tree/main/linting/docs -# ========================================================================================= - -name: Caller for Spectral linting with CAMARA ruleset - -on: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true - -permissions: - # Grant necessary write permissions for PRs and issues - pull-requests: write - contents: read - issues: write - -jobs: - spectral: - # Invoke the reusable PR validation workflow from the main branch of camaraproject/tooling - uses: camaraproject/tooling/.github/workflows/spectral-oas.yml@v0 -# Spectral configuration from the tooling repository subfolder of /linting/config/ indicated by `configurations` variable -# If needed, you can specify a configuration from another subfolder of camaraproject/tooling/linting/config/ (uncomment below) -# with: -# configurations: api-name diff --git a/release_automation/docs/technical-architecture.md b/release_automation/docs/technical-architecture.md index e5805bb5..b715ba56 100644 --- a/release_automation/docs/technical-architecture.md +++ b/release_automation/docs/technical-architecture.md @@ -899,34 +899,23 @@ Repository rulesets enforce these protections. GitHub Actions is configured as a --- -## 8. pr_validation Integration +## 8. Release Plan Changes in Pull Requests -When `release-plan.yaml` changes in a PR, the existing `pr_validation` workflow performs additional checks. After the PR merges and `release-plan.yaml` lands on main, the push trigger automatically runs the release automation workflow. +When `release-plan.yaml` changes in a PR, CAMARA Validation (the validation workflow of the API repository) runs the release-plan checks. After the PR merges and `release-plan.yaml` lands on main, the push trigger runs the release automation workflow. -### 8.1 Artifact State Check +### 8.1 Active Release Check -During PR validation, a simple check blocks the PR if a snapshot is active: - -```bash -# Check for snapshot branch - blocks PR if active -SNAPSHOT=$(gh api repos/$OWNER/$REPO/branches \ - --jq ".[] | select(.name | startswith(\"release-snapshot/$TARGET_TAG-\"))") - -if [ -n "$SNAPSHOT" ]; then - echo "::error::Cannot modify release-plan.yaml while snapshot is active" - exit 1 -fi -``` +Rule P-033 (`check-release-plan-active-release-state`) blocks the PR with an error while a release is active: a `release-snapshot/-*` branch exists, or the derived release state is `snapshot-active` or `draft-ready`. The release automation workflow derives the state; the validation check consumes it offline. ### 8.2 State Transition Cases -| Current State | release-plan.yaml Change | pr_validation Action | release-automation Action | -|---------------|--------------------------|---------------------|---------------------------| +| Current State | release-plan.yaml Change | CAMARA Validation (PR) | release-automation Action | +|---------------|--------------------------|------------------------|---------------------------| | No issue | Valid plan (type ≠ none) | Pass | Create issue (PLANNED) | | PLANNED | Plan updated | Pass | Update issue | | PLANNED | type → none | Pass | Set NOT_PLANNED, suggest close | -| SNAPSHOT_ACTIVE | Any change | **Block (exit 1)** | — | -| DRAFT_READY | Any change | **Block (exit 1)** | — | +| SNAPSHOT_ACTIVE | Any change | **Block (P-033)** | — | +| DRAFT_READY | Any change | **Block (P-033)** | — | | PUBLISHED | Any change | Pass (new release cycle) | Create new issue if type ≠ none | --- diff --git a/tooling_lib/ci_plan.py b/tooling_lib/ci_plan.py index 66863917..65875dd3 100644 --- a/tooling_lib/ci_plan.py +++ b/tooling_lib/ci_plan.py @@ -41,7 +41,6 @@ def matches(*patterns: str) -> bool: "shared-actions/run-validation/**", "shared-actions/validate-release-plan/**", "validation/workflows/**", - "linting/workflows/**", ".github/workflows/validation.yml", ".github/workflows/validation-regression.yml", ".github/workflows/validation-settings-ci.yml", diff --git a/validation/tests/test_rule_metadata_integrity.py b/validation/tests/test_rule_metadata_integrity.py index f32191f2..041f0377 100644 --- a/validation/tests/test_rule_metadata_integrity.py +++ b/validation/tests/test_rule_metadata_integrity.py @@ -42,7 +42,6 @@ _SPECTRAL_R34_CONFIG = _LINTING_DIR / ".spectral-r3.4.yaml" _SPECTRAL_R4_CONFIG = _LINTING_DIR / ".spectral-r4.yaml" _GPLINT_CONFIG = _LINTING_DIR / ".gplintrc" -_LEGACY_GHERKIN_CONFIG = _LINTING_DIR / ".gherkin-lintrc" _YAMLLINT_CONFIG = _LINTING_DIR / ".yamllint.yaml" # Rule ID pattern from schema @@ -214,14 +213,6 @@ def _load_gplint_config(cls) -> dict: """Load .gplintrc, allowing // comments.""" return cls._load_jsonc_config(_GPLINT_CONFIG, "GPLint config not found") - @classmethod - def _load_legacy_gherkin_config(cls) -> dict: - """Load legacy .gherkin-lintrc, allowing // comments.""" - return cls._load_jsonc_config( - _LEGACY_GHERKIN_CONFIG, - "legacy Gherkin config not found", - ) - def _get_gherkin_enabled_rules(self) -> set[str]: """Extract enabled GPLint rules for the gherkin validation engine.""" data = self._load_gplint_config() @@ -298,15 +289,6 @@ def test_gplint_required_tags_config_shape(self): assert config["scenario"] == ["/^@.*$/"] assert config["ignoreUntagged"] is False - def test_legacy_gherkin_lint_config_remains_v0_shape(self): - """Legacy v0 config must stay compatible with gherkin-lint.""" - data = self._load_legacy_gherkin_config() - assert data["only-one-when"] == "off" - level, config = data["required-tags"] - assert level == "on" - assert config["tags"] == ["^@.*$"] - assert "scenario" not in config - def test_yamllint_coverage(self, rule_index): """Every enabled yamllint rule has a metadata entry.""" enabled = self._get_yamllint_enabled_rules()