Skip to content

LINBEE-30104 | fix: keep the repo-health cache per LinearB environment - #19

Merged
nivSwisa1 merged 1 commit into
mainfrom
LINBEE-30104-cache-per-env
Oct 15, 2026
Merged

nivSwisa1 merged 1 commit into
mainfrom
LINBEE-30104-cache-per-env

Conversation

@nivSwisa1

@nivSwisa1 nivSwisa1 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

The 24h repo-health cache key now includes LINEARB_API_URL when it is not the prod default, so a grade from one LinearB environment is never reused for another; prod cache entries keep their old key (follow-up to Copilot on lb-claude-plugins#130). Bumps to 1.4.2: merge after #18 (1.4.1).

🤖 Generated with Claude Code

✨ PR Description

Purpose: Ensure repo-health cache isolation between different LinearB environments by incorporating the API URL into the cache key.

Main changes:

  • Updated cache key logic in SKILL.md to include LINEARB_API_URL when non-default
  • Bumped plugin version to 1.4.2 and updated CHANGELOG.md with cache fix details
  • Refined session reuse documentation to account for API URL changes

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 15, 2026 09:32

@orca-security-us orca-security-us 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.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed OSS Licenses high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@gitstream-cm gitstream-cm 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.

✨ PR Review

The PR scopes the repo-health cache key by LINEARB_API_URL for non-prod environments and bumps the plugin version. The logic is sound, but there are minor concerns around the changelog and URL normalization. The PR is unrelated to the linked ticket's scoped-token work.

2 issues detected:

🧹 Maintainability - The changelog has no 1.4.1 entry between 1.4.0 and 1.4.2.

Details: The changelog jumps from 1.4.0 to 1.4.2 with no 1.4.1 entry. The PR says it should merge after #18 (1.4.1), so the 1.4.1 entry is expected to arrive with that PR. If merge order changes, or #18 does not add its own entry, the changelog will have a gap and a possible conflict.

File: plugins/agentic-advisor/CHANGELOG.md (3-7)

🐞 Bug - URL normalization is limited to stripping a trailing slash, so equivalent URLs yield different cache keys. 🛠️

Details: Only a trailing slash is stripped from the API URL before it is compared to the prod default. Case differences in the host, or an http:// prefix, produce a different key for the same environment. The same environment may then be cached under multiple keys, and a prod URL written with different casing gets a non-prod key. This only causes cache misses, never cross-environment reuse.

File: plugins/agentic-advisor/skills/agentic-advisor/SKILL.md (53-53)

🛠️ A suggested code correction is included in the review comments.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

root="$(git -C "<cwd>" rev-parse --show-toplevel)"; h="$(printf '%s' "$root" | { if command -v shasum >/dev/null 2>&1; then shasum; else sha1sum; fi; } | cut -c1-12)"
# repo-hash = first 12 chars of the sha1 (shasum on macOS, sha1sum on Linux) of the repo root, plus the API URL
# when it isn't the prod default, so grades from different LinearB environments never mix
root="$(git -C "<cwd>" rev-parse --show-toplevel)"; api="${LINEARB_API_URL:-https://public-api.linearb.io}"; api="${api%/}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🐞 Bug - Incomplete URL Normalization: Lowercase the URL before comparing and hashing, for example api="$(printf '%s' "${api%/}" | tr '[:upper:]' '[:lower:]')".

Suggested change
root="$(git -C "<cwd>" rev-parse --show-toplevel)"; api="${LINEARB_API_URL:-https://public-api.linearb.io}"; api="${api%/}"
root="$(git -C "<cwd>" rev-parse --show-toplevel)"; api="${LINEARB_API_URL:-https://public-api.linearb.io}"; api="$(printf '%s' "${api%/}" | tr '[:upper:]' '[:lower:]')"
Is this review accurate? Use 👍 or 👎 to rate it

If you want to tell us more, use /gs feedback e.g. /gs feedback this review doesn't make sense, I disagree, and it keeps repeating over and over

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Skipping: a differently-cased URL only gets its own cache entry, which is the safe direction (an extra fresh grade, never a wrong reuse).

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.

🟡 Changes recommended

Legacy non-production cache entries can still be reused as production verdicts after upgrading.

1 open finding
What changed in this PR

Scopes the agentic-advisor’s repo-health cache by LinearB environment while preserving the production cache key.

Changes:

  • Includes non-default API URLs in cache keys and restricts in-session reuse.
  • Documents the fix and bumps the plugin to 1.4.2.
File Description
plugins/​agentic-advisor/​skills/​agentic-advisor/​SKILL.md Updates cache keys and reuse instructions.
plugins/​agentic-advisor/​CHANGELOG.md Records the environment-specific cache fix.
plugins/​agentic-advisor/​.claude-plugin/​plugin.json Bumps the version to 1.4.2.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

# repo-hash = first 12 chars of the sha1 (shasum on macOS, sha1sum on Linux) of the repo root, plus the API URL
# when it isn't the prod default, so grades from different LinearB environments never mix
root="$(git -C "<cwd>" rev-parse --show-toplevel)"; api="${LINEARB_API_URL:-https://public-api.linearb.io}"; api="${api%/}"
key="$root"; [ "$api" = "https://public-api.linearb.io" ] || key="$root|$api"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Accepting this edge: it needs a non-default LINEARB_API_URL used before the upgrade and a switch back to prod within 24h, and the cost is one stale repo-health grade (task and file axes are always fresh). Invalidating every prod cache to close it costs all users a re-grade.

@MishaKav MishaKav left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@nivSwisa1
nivSwisa1 merged commit ebb8a00 into main Oct 15, 2026
16 checks passed
@nivSwisa1
nivSwisa1 deleted the LINBEE-30104-cache-per-env branch October 15, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants