Add lightweight ADR process with Undecided state and CI linting - #39
Conversation
Introduce Architecture Decision Records to crystallize decisions as problem-space exploration matures. Key features: - ADR template supporting Proposed, Undecided, Accepted, Deprecated, and Superseded statuses. The Undecided state allows merging ADRs that frame a decision and its options before consensus forms. - ADR 0001 records the decision to adopt ADRs. - Linting scripts adapted from konflux-ci/architecture to validate ADR statuses and check for duplicate numbering. - Makefile with lint target for local validation. Note: .github/workflows/lint.yml is included as a separate commit since pushing workflow files requires the 'workflow' PAT scope. Assisted-by: OpenCode claude-opus-4-6@default
Runs 'make lint' on pushes to main and pull requests to validate ADR statuses and number uniqueness. Assisted-by: OpenCode claude-opus-4-6@default
Review Summary by QodoIntroduce lightweight ADR process with CI linting
WalkthroughsDescription• Introduce Architecture Decision Records (ADRs) process with five statuses - Proposed, Undecided, Accepted, Deprecated, Superseded • Undecided state enables merging ADRs before consensus forms • Add ADR template and first ADR documenting adoption decision • Implement linting scripts to validate ADR statuses and number uniqueness • Add Makefile with lint targets and GitHub Actions CI workflow Diagramflowchart LR
A["ADR Template<br/>0000-adr-template.md"] --> B["ADR 0001<br/>Use ADRs Decision"]
C["Linting Scripts<br/>get-adr-status.sh<br/>lint-adr-status<br/>lint-adr-numbers"] --> D["Makefile<br/>lint targets"]
D --> E["GitHub Actions<br/>lint.yml workflow"]
B --> F["docs/ADRs/<br/>Directory"]
C --> F
File Changes1. hack/util/get-adr-status.sh
|
Code Review by Qodo
1. ADR 0001 lacks options
|
Add structured frontmatter to ADR files, adapted from the konflux-ci/architecture repo. Instead of mapping ADRs to services (applies_to), fullsend maps ADRs to problem documents (relates_to) since problem docs are the primary organizational unit here. Frontmatter fields: - title (required) - ADR title - status (required) - must match the ## Status section in the body - relates_to - list of problem doc filenames (without .md) from docs/problems/, or "*" for cross-cutting ADRs - topics - free-form tags for discoverability The lint-adr-frontmatter script validates all of the above, including cross-reference checking against existing problem docs. Assisted-by: OpenCode claude-opus-4-6@default
Additional Review Findings (not covered by Qodo)Reviewed with Claude Code and Gemini. These are issues Qodo's review did not flag. Critical1. Bash 4.0+ required but not checked —
Suggested fix — add a version check at the top of the script: if ((BASH_VERSINFO[0] < 4)); then
error "This script requires Bash 4.0 or higher (found ${BASH_VERSION})"
error "On macOS, install via: brew install bash"
exit 1
fiMinor2. PyYAML not installed in CI workflow
- name: Install Python dependencies
run: pip install pyyaml3. Template frontmatter contains invalid YAML — status: Proposed | Undecided | Accepted | Deprecated | SupersededThis is a string literal, not a choice selector. Contributors copying the template verbatim will get lint errors. Consider: status: Proposed # Valid values: Proposed, Undecided, Accepted, Deprecated, Superseded4. Makefile default target runs lint instead of help Running .DEFAULT_GOAL := helpNit5. Qodo's "ADR 0001 lacks Options section" finding is a false positive — the template states Options is "Required for Undecided ADRs" and ADR 0001 has status Accepted. The ADR correctly follows the template for its status. |
Fixes from review by waynesun09 and Qodo: - Fix ((errors++)) under set -e in lint-adr-status: post-increment evaluates to 0 on first error, causing set -e to exit early. Use ((++errors)) instead (pre-increment evaluates to 1). - Remove Bash 4.0+ dependency from lint-adr-numbers: replace associative array with sort | uniq -d for duplicate detection. Simpler and works on macOS default Bash 3.2. - Fix template frontmatter: status field had pipe-separated values which is a string literal, not valid YAML for a status. Use a comment to document valid values instead. - Add .DEFAULT_GOAL := help to Makefile so bare 'make' shows help. The Qodo finding about ADR 0001 lacking an Options section is a false positive: Options are only required for Undecided ADRs per the template, and ADR 0001 has status Accepted. Workflow changes (permissions block, pip install pyyaml) require the 'workflow' PAT scope and are in a separate commit. Assisted-by: OpenCode claude-opus-4-6@default
Runs 'make lint' on pushes to main and pull requests to validate ADR statuses and number uniqueness. Assisted-by: OpenCode claude-opus-4-6@default
Experiment code has heavy dependencies (torch, transformers, anthropic) that aren't installed in CI. ty runs locally via pre-commit where developers have their venv. The CI ty step can be added back when hack/ scripts land (PR #39) as a lightweight target. Signed-off-by: Wayne Sun <gsun@redhat.com>
Add pre-commit configuration with: - ruff for linting and formatting - ty for type checking (via uvx) - bandit for Python security scanning - gitleaks for secret detection - actionlint for GitHub Actions workflow validation - pre-commit-hooks for YAML/JSON/TOML validation and private key detection Update CI workflow to use uv + pre-commit + ty check hack/ with explicit permissions: contents: read. Add PEP 723 inline script metadata to hack/lint-adr-frontmatter so uv run auto-installs PyYAML without needing a pyproject.toml. Update Makefile with check and fmt targets. Pattern borrowed from redhat-community-ai-tools/cicaddy-action. Signed-off-by: Wayne Sun <gsun@redhat.com>
Auto-fix import sorting (I001), unused imports (F401), line length (E501), trailing whitespace, and missing trailing newlines across experiment code and problem docs. Signed-off-by: Wayne Sun <gsun@redhat.com>
Convert .format() calls to f-strings, remove unnecessary "r" mode args from open(), and combine nested if statements. Signed-off-by: Wayne Sun <gsun@redhat.com>
|
@waynesun09 thanks for the fixups! This needs an approval from @konflux-ci/fullsend-sig in order to merge. |
Introduce Architecture Decision Records to crystallize decisions as problem-space exploration matures. Key features:
Note: .github/workflows/lint.yml is included as a separate commit since pushing workflow files requires the 'workflow' PAT scope.
Assisted-by: OpenCode claude-opus-4-6@default