Skip to content

ci: prevent SNAPSHOT releases; bump to 0.1.6-SNAPSHOT#49

Open
WilliamAGH wants to merge 4 commits intomainfrom
dev
Open

ci: prevent SNAPSHOT releases; bump to 0.1.6-SNAPSHOT#49
WilliamAGH wants to merge 4 commits intomainfrom
dev

Conversation

@WilliamAGH
Copy link
Owner

Mirrors the Maven Central publishing guardrails used in tui4j.

Changes:

  • Release workflow: fail fast if the release tag ends with -SNAPSHOT (Central releases reject SNAPSHOTs).
  • CI workflow: only publish snapshots when VERSION_NAME ends with -SNAPSHOT; publish snapshots without overriding -Pversion (uses gradle.properties).
  • gradle.properties: bump VERSION_NAME to 0.1.6-SNAPSHOT.
  • README: document Sonatype snapshot repository + snapshot dependency coordinates.

Verification:

  • ./gradlew build

WilliamAGH and others added 4 commits January 23, 2026 01:19
When triggered by release:published events, GitHub Actions checks out the
release tag (detached HEAD) rather than a branch. This caused git push to
fail with "You are not currently on a branch" error.

Fixed by explicitly specifying ref: main in the checkout step, ensuring
the workflow always operates on the main branch regardless of trigger.
The repository’s agent guidance needed to be more explicit and linkable, with
stable rule hashes that can be cited during reviews and automated changes.
This formalizes additional non-negotiables (verification, SRP, LOC ceilings,
dependency source inspection) and adds a single “code change contract” so
new work follows consistent placement and splitting decisions.

- Expand AGENTS rule summary and add missing rule sections/hashes
- Add dependency source verification workflow (Gradle cache / sources JAR)
- Add LOC ceiling and no-monolith decision rules (new file vs edit)
- Add a contracts doc with a decision matrix and verification gates
Docs pages currently lack frontmatter metadata and there is no Mintlify docs
configuration to define navigation and site identity. This adds the Mintlify
`docs.json` plus per-page titles so the documentation can be rendered and
navigated consistently.

- Add docs/docs.json with theme, name, and grouped navigation
- Add YAML frontmatter titles to core docs pages
- Include Contracts navigation entry pointing at the code-change contract page
@coderabbitai
Copy link

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Documentation

    • Added Snapshots section with instructions for configuring and using snapshot artifacts from Sonatype repository
    • Introduced Code Change Policy Contract with development guidelines and verification gates
    • Enhanced governance policies and development standards documentation
    • Updated documentation structure with improved metadata and navigation
  • Chores

    • Version updated to 0.1.6-SNAPSHOT

Walkthrough

This pull request establishes snapshot release infrastructure and governance policies. It updates GitHub Actions workflows to detect and conditionally handle SNAPSHOT versions, bumps the project version to 0.1.6-SNAPSHOT in gradle.properties, adds documentation for snapshot artifacts and code-change policies, and introduces enhanced policy governance rules.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/CI.yaml, .github/workflows/Release.yaml, .github/workflows/UpdateReadmeVersion.yaml
Enhanced version detection logic: CI workflow now extracts SNAPSHOT status into is_snapshot output; Release workflow adds validation to fail if version contains -SNAPSHOT suffix; UpdateReadmeVersion explicitly checks out the main branch.
Version Configuration
gradle.properties
Updated VERSION_NAME from 0.1.5 to 0.1.6-SNAPSHOT, enabling snapshot release builds.
Documentation & Metadata
docs/usage.md, docs/cli.md, docs/authorization.md, docs/tests.md, docs/docs.json
Added YAML front matter (title metadata) to existing docs; introduced new Mintlify docs.json configuration file for documentation site structure and branding.
Policy & Architecture Guidance
AGENTS.md, docs/contracts/code-change.md
Expanded governance rules with Zero Tolerance Policy (ZA1), enhanced Git & Permissions (GT1), Clean Code & DDD (CC1), and new policies covering idiomatic patterns, dependency verification, and architectural constraints; added comprehensive Code Change Policy Contract detailing SRP/DDD adherence, LOC caps, and layer responsibilities.
User Documentation
README.md
Added new "Snapshots" section documenting snapshot artifact access via Sonatype repository with configuration examples for Gradle and Maven.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

📸 A snapshot springs to life, preserving work in flight,
New rules and docs illuminate the path so bright,
Governance flows like clarity through every line,
Version bumped and workflows synced—a steady climb! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (10 files):

⚔️ .github/workflows/CI.yaml (content)
⚔️ .github/workflows/Release.yaml (content)
⚔️ .github/workflows/UpdateReadmeVersion.yaml (content)
⚔️ AGENTS.md (content)
⚔️ README.md (content)
⚔️ docs/authorization.md (content)
⚔️ docs/cli.md (content)
⚔️ docs/tests.md (content)
⚔️ docs/usage.md (content)
⚔️ gradle.properties (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: preventing SNAPSHOT releases in the workflow and bumping the version to a SNAPSHOT version, which are the core objectives.
Description check ✅ Passed The description provides relevant context about the changeset, explaining the workflow modifications, version bump, and documentation additions that align with the file changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch dev
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3134895ba2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

dependencies {
implementation("com.williamcallahan:apple-maps-java:0.1.6-SNAPSHOT")

Choose a reason for hiding this comment

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

P2 Badge Prevent README updater from rewriting snapshot coordinate

Adding this -SNAPSHOT dependency example introduces a regression with the existing UpdateReadmeVersion workflow: its global regex replacement updates every implementation("com.williamcallahan:apple-maps-java:...") occurrence, so the next scheduled/release run will overwrite this snapshot line to the latest release version and break the snapshot instructions. Scope the replacement to the release-install snippet (or explicitly exclude the snapshot block) so docs stay correct after automation runs.

Useful? React with 👍 / 👎.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/CI.yaml:
- Around line 32-41: The version_check step currently sets VERSION from
gradle.properties but will silently treat a missing or empty VERSION_NAME as
non-snapshot; modify the run block for the step with id version_check to enable
strict shell mode (set -euo pipefail) and add an explicit non-empty check for
VERSION (e.g., if [ -z "$VERSION" ]; then echo "ERROR: VERSION_NAME not found or
empty" >&2; exit 1; fi) before the SNAPSHOT test, so the job fails fast and
loudly when VERSION_NAME is absent.

Comment on lines +32 to +41
- name: Check if SNAPSHOT version
id: version_check
run: |
VERSION=$(grep '^VERSION_NAME=' gradle.properties | cut -d'=' -f2)
echo "VERSION=${VERSION}-SNAPSHOT" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
if [[ "$VERSION" == *-SNAPSHOT ]]; then
echo "is_snapshot=true" >> $GITHUB_OUTPUT
else
echo "is_snapshot=false" >> $GITHUB_OUTPUT
fi
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Guard against missing VERSION_NAME to avoid silent skips.

If VERSION_NAME is absent or empty, this step will quietly set is_snapshot=false and skip snapshot publishing. Adding strict mode + a non-empty check makes the failure loud and easy to debug. Tiny CI hygiene win. 🌱

✅ Suggested hardening
       - name: Check if SNAPSHOT version
         id: version_check
+        shell: bash
         run: |
-          VERSION=$(grep '^VERSION_NAME=' gradle.properties | cut -d'=' -f2)
+          set -euo pipefail
+          VERSION=$(grep -E '^VERSION_NAME=' gradle.properties | head -n1 | cut -d'=' -f2 | tr -d '\r')
+          if [[ -z "$VERSION" ]]; then
+            echo "::error::VERSION_NAME not found in gradle.properties"
+            exit 1
+          fi
           echo "Version: $VERSION"
           if [[ "$VERSION" == *-SNAPSHOT ]]; then
-            echo "is_snapshot=true" >> $GITHUB_OUTPUT
+            echo "is_snapshot=true" >> "$GITHUB_OUTPUT"
           else
-            echo "is_snapshot=false" >> $GITHUB_OUTPUT
+            echo "is_snapshot=false" >> "$GITHUB_OUTPUT"
           fi
🤖 Prompt for AI Agents
In @.github/workflows/CI.yaml around lines 32 - 41, The version_check step
currently sets VERSION from gradle.properties but will silently treat a missing
or empty VERSION_NAME as non-snapshot; modify the run block for the step with id
version_check to enable strict shell mode (set -euo pipefail) and add an
explicit non-empty check for VERSION (e.g., if [ -z "$VERSION" ]; then echo
"ERROR: VERSION_NAME not found or empty" >&2; exit 1; fi) before the SNAPSHOT
test, so the job fails fast and loudly when VERSION_NAME is absent.

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.

1 participant