Skip to content

Feat/configure codacy cloud language file counts - #6

Merged
manufacturist merged 4 commits into
masterfrom
feat/configure-codacy-cloud-language-file-counts
Jun 19, 2026
Merged

Feat/configure codacy cloud language file counts#6
manufacturist merged 4 commits into
masterfrom
feat/configure-codacy-cloud-language-file-counts

Conversation

@manufacturist

Copy link
Copy Markdown
Contributor

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).

manufacturist and others added 2 commits June 18, 2026 15:14
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>
Copilot AI review requested due to automatic review settings June 18, 2026 12:20

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread skills/configure-codacy-cloud/SKILL.md Outdated

3. **The Cloud CLI exposes `fileCount`.** Confirm with:
```bash
codacy repo -o json 2>/dev/null | jq -e '.repository | has("fileCount")'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
codacy repo -o json 2>/dev/null | jq -e '.repository | has("fileCount")'
codacy repo -o json 2>/dev/null | jq -e '.repository.fileCount != null'

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-cloud skill version from 1.0.0 to 1.1.0.
  • Documents capturing languageCount and fileCount from codacy repo -o json and 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:
Comment thread skills/configure-codacy-cloud/SKILL.md Outdated
```
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>
Comment thread skills/configure-codacy-cloud/SKILL.md Outdated
```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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>
Copilot AI review requested due to automatic review settings June 19, 2026 09:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines +38 to +42
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.
Comment on lines +133 to +137
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
@manufacturist
manufacturist merged commit 96c928a into master Jun 19, 2026
1 check passed
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.

3 participants