Feat/configure codacy cloud language file counts - #6
Conversation
Extends the summary block emitted to .codacy/configure-codacy-cloud-summary.json with two repo-level descriptors: - languageCount — from .repository.repository.languages.length (always available) - fileCount — from .repository.fileCount (requires Cloud CLI ≥ 1.3.0; null on older versions) Both come from the same `codacy repo -o json` call the skill already issues in startup step 5, so no extra API roundtrips. They live under `summary` as scalars alongside the before/after pairs since they are repo state snapshots, not tuning deltas. Bumps skill version 1.0.0 → 1.1.0 (additive schema change). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the per-field "requires CLI ≥ 1.3.0; null on older versions"
note with a startup feature-presence check, so the skill fails loudly
on outdated CLIs instead of silently emitting null fileCount values
that would confuse downstream BI dashboards.
The check probes `.repository | has("fileCount")` rather than
`--version` because the current CLI hardcodes its --version string.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates the Codacy Cloud configuration skill to version 1.1.0, introducing a third hard requirement to verify that the Cloud CLI exposes the fileCount field. It also adds instructions to capture and document repo-level descriptors (languageCount and fileCount) in the final summary. The review feedback suggests a more robust jq check to ensure fileCount is not only present but also non-null, preventing potential issues with older CLI versions.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| 3. **The Cloud CLI exposes `fileCount`.** Confirm with: | ||
| ```bash | ||
| codacy repo -o json 2>/dev/null | jq -e '.repository | has("fileCount")' |
There was a problem hiding this comment.
Using has("fileCount") will return true even if the fileCount key exists but its value is null (which can happen on older versions of the CLI or platform as noted in the description). Checking .repository.fileCount != null is more robust as it ensures the field is both present and populated with a non-null value.
| codacy repo -o json 2>/dev/null | jq -e '.repository | has("fileCount")' | |
| codacy repo -o json 2>/dev/null | jq -e '.repository.fileCount != null' |
There was a problem hiding this comment.
Pull request overview
This PR updates the configure-codacy-cloud skill documentation and version to support emitting two additional repo-level descriptors (languageCount and fileCount) into .codacy/configure-codacy-cloud-summary.json as additive summary scalars.
Changes:
- Bumps
configure-codacy-cloudskill version from1.0.0to1.1.0. - Documents capturing
languageCountandfileCountfromcodacy repo -o jsonand adds them to the Summary JSON example. - Updates the “Field reference” section to describe the new summary fields.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Both CLIs share credentials at `~/.codacy/credentials`, so a single login covers both. | ||
|
|
||
| This skill has **two hard requirements**. Verify both before doing anything else and stop with clear guidance if either fails: | ||
| This skill has **three hard requirements**. Verify all three before doing anything else and stop with clear guidance if any fails: |
| ``` | ||
| For **cloud-only** tools, add their enabled-pattern counts: `codacy patterns <tool> --enabled -o json 2>/dev/null | jq 'length'` per tool — but mind the pagination caveat above: this is capped at 100, so a cloud-only tool with more than 100 enabled patterns will be undercounted. <!-- TODO(--limit): once `codacy patterns` supports `--limit`, pass `--limit <n>` here to get an accurate cloud-only count and drop the 100-cap workaround. --> The BEFORE `enabledPatterns` is the sum of the supported-tool count and the cloud-only counts; BEFORE `enabledTools` is the enabled-tool count. | ||
|
|
||
| 7. **Capture repo-level descriptors** for the summary (single source: the same `codacy repo -o json` call used in step 5): |
- Prereq #3 now probes `.repository.fileCount != null` instead of `has("fileCount")` so it rejects both absent keys and explicit nulls (per gemini-code-assist). - Step 7 wording no longer claims to reuse the step 5 call — it's a fresh `codacy repo -o json`, cached locally so both fields read from a single invocation (per Copilot). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| ```bash | ||
| codacy repo -o json 2>/dev/null | jq -e '.repository.fileCount != null' | ||
| ``` | ||
| If this prints `false` (or errors), stop. The installed Cloud CLI is too old to populate the summary's `fileCount` field. Tell the user to upgrade (`npm install -g @codacy/codacy-cloud-cli@latest`) and rerun. The check uses `!= null` rather than `has("fileCount")` so it rejects both absent keys and explicit nulls, and feature presence is checked rather than `--version` because the current CLI hardcodes its `--version` string. |
There was a problem hiding this comment.
for now this is a .... hack.... but we need to add a few things:
- "new version" available banner in both CLIs when they run
- minimum version required to the skills
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| 3. **The Cloud CLI is ≥ 1.3.0** (required to populate `fileCount`). Confirm with: | ||
| ```bash | ||
| codacy repo -o json 2>/dev/null | jq -e '.repository.fileCount != null' | ||
| ``` | ||
| If this prints `false` (or errors), stop. The installed Cloud CLI is older than 1.3.0 and does not populate the summary's `fileCount` field. Tell the user to upgrade to at least 1.3.0 (`npm install -g @codacy/codacy-cloud-cli@latest`) and rerun. The check uses `!= null` rather than `has("fileCount")` so it rejects both absent keys and explicit nulls, and feature presence is checked rather than `--version` because the current CLI hardcodes its `--version` string. |
| 7. **Capture repo-level descriptors** for the summary: | ||
| ```bash | ||
| codacy repo -o json 2>/dev/null > .codacy/tmp/repo.json | ||
| jq '.repository.repository.languages | length' .codacy/tmp/repo.json # → languageCount | ||
| jq '.repository.fileCount' .codacy/tmp/repo.json # → fileCount |
Extends the summary block emitted to .codacy/configure-codacy-cloud-summary.json with two repo-level descriptors:
Both come from the same
codacy repo -o jsoncall the skill already issues in startup step 5, so no extra API roundtrips. They live undersummaryas scalars alongside the before/after pairs since they are repo state snapshots, not tuning deltas.Bumps skill version 1.0.0 → 1.1.0 (additive schema change).