Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ jobs:
- run: npm test
- run: npm run build:types

# Tokenless publish of the single public workspace. `publishConfig.access`
# is already "public" in the package.json; --access public is belt-and-suspenders.
# npm auto-generates build provenance because id-token: write is set.
- name: Publish to npm
run: npm publish --workspace @newrelic/query-bridge --access public

# Runs after the publish so a rejected publish leaves no tag or release
# behind to delete before the retry.
- name: Create tag and release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -104,9 +112,3 @@ jobs:
git tag "v${version}"
git push --tags
gh release create "v${version}" --generate-notes

# Tokenless publish of the single public workspace. `publishConfig.access`
# is already "public" in the package.json; --access public is belt-and-suspenders.
# npm auto-generates build provenance because id-token: write is set.
- name: Publish to npm
run: npm publish --workspace @newrelic/query-bridge --access public
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Multi-language query translator. SPL/Lucene/PromQL/PPL → NRQL/Trino. Pure ESM
* **Do not hand-zip / `tar` the working directory to share it.** It sweeps in `node_modules`, `.git`, and the gitignored `docs/local/` (private data that must not leave the repo). See "Packaging & distribution" in README.md.
* **OSS-bound — never commit customer identifiers** (names, hosts, indexes, customer-specific field names); use placeholders (`userId`, `region_north`). A pre-commit scan (`scripts/scan-customer-names.sh`) enforces this against a denylist whose canonical copy is **tracked in the private `../nr-query-bridge-corpus` repo** (a gitignored-only list gets lost — that's how the original `scrub-mappings.yml` vanished). The scan SKIPS when no denylist is present, so the rule stands even when it can't run. See CONTRIBUTING "Sensitive data".
* **Small PRs, and every spec/plan MUST plan them.** Keep each PR to one reviewable concern: separate refactor/rename/move from behavior change and land the refactor *first*, then cut along the pipeline seams (grammar + `build:parsers` → IR node + factory → optimizer pass → emitter + message keys → wiring + `spl.test.js` cases) so each step reviews in isolation. **Every spec/plan under `docs/superpowers/` MUST end with an ordered "PR breakdown" section** — a numbered list where each entry states that PR's scope, its dependency on the previous one, and roughly its size, smallest shippable slice first and scaffolding/plumbing before the feature that consumes it. Default target ≤~400 changed lines per PR; a slice that exceeds that gets split further. A spec that would land as one massive PR is incomplete — the PR breakdown is a required deliverable, not an afterthought.
* **Sidekick review waived for this repo (approved exception SLCREV-1164).** While this stays a private GHE (`source.datanerd.us`) repo built for a single customer, the S-5 sidekick-review / branch-protection requirement is waived per SLCREV-1164 (approved 2026-06-29 — Security review complete, Compliance approved, Legal not required). So merging a user-approved PR solo via `gh pr merge --admin --rebase` is sanctioned here, **not** a standards bypass — and the `sidekick:approved` label stays unnecessary (never apply it to fake a review). **Caveat: the exception does NOT cover the public-GitHub phase** — once this repo moves to public GitHub, a second collaborator is required to satisfy branch protection (per Compliance on SLCREV-1164).
* **NRQL validation: `execute_nrql_query` runs an older NRQL grammar — re-check failures via `run_nerdgraph_query` or the UI.** It falsely rejects 12 functions (`jparse`, `convert`, `cidrAddress`, `toTimestamp`, `toDatetime`, `encode`, `decode`, `mapKeys`, `mapValues`, `split`, `replace`, `aggregateFunnel`) AND the `PREDICT` clause → they error via `execute_nrql_query` but run fine via `run_nerdgraph_query` and the UI (verified acct 1, 2026-06-24). NOT affected: `blob`, `lookup`, `stddev`, `subnet`, `meta`, `hdrHistogram`/`hdrPercentile`/`hdrPercentiles`, `attributeCardinality`, `SLIDE BY`. The `nrql-validator` agent / `nrql-validation` + `nrql-knowledge` skills inherit this. (Note: `Unknown function count()` from wrapping an aggregate in a function that can't take one — e.g. `numeric(count(x))` — is NOT a tool bug; it's an invalid query, deterministic on both tools. `string()` can wrap an aggregate, `numeric()` can't.) Full classified list: `.claude/references/nrql-reference.md`.
* **Merging needs one approving review, and nobody can bypass it.** The public repo's `Branch Protection` ruleset requires 1 approving review on `master` and has no bypass actors, so `gh pr merge --admin` does not get around it. Pushing new commits to a PR dismisses its approval. The old SLCREV-1164 solo-merge waiver covered only the archived GHE repo.
* **NRQL validation: trust `execute_nrql_query`'s errors — its old grammar gap is gone.** The 12 functions it used to falsely reject (`jparse`, `convert`, `cidrAddress`, `toTimestamp`, `toDatetime`, `encode`, `decode`, `mapKeys`, `mapValues`, `split`, `replace`, `aggregateFunnel`) and the `PREDICT` clause all run correctly through it now, each re-tested individually against acct 11811040 on 2026-09-29. Do not mark one unsupported on the strength of the old caveat, and do not route around the tool. (`Unknown function count()` from wrapping an aggregate in a function that can't take one — e.g. `numeric(count(x))` — was never a tool bug; it's an invalid query, deterministic on both tools. `string()` can wrap an aggregate, `numeric()` can't.) `PREDICT`'s syntax is `PREDICT BY <n> <unit>`; the bare form is a real syntax error. Full classified list: `.claude/references/nrql-reference.md`.

## Build & Test

Expand Down
Loading