Skip to content

feat: name the actions a refused query takes - #92

Merged
hughgrigg merged 2 commits into
mainfrom
feat/name-refused-query-actions
Aug 28, 2026
Merged

feat: name the actions a refused query takes#92
hughgrigg merged 2 commits into
mainfrom
feat/name-refused-query-actions

Conversation

@hughgrigg

Copy link
Copy Markdown
Contributor

A caller who could not start a query got whatever the SDK threw with a sentence about the region on the end, which on a permissions failure pointed at the one thing that was already right. The command line now recognises a refusal AWS gave for want of a permission and names the four actions running a query takes, being athena:StartQueryExecution and athena:StopQueryExecution on the workgroup and s3:PutObject and s3:AbortMultipartUpload on the bucket that workgroup writes results to, then points at the summary path, since the five named questions answer from a precomputed summary on s3:GetObject alone and an identity refused a query usually still has an answer available. The message lives in queryRows rather than in refusalIn, which the scheduled job shares and which has no summary to offer, so a refusal about anything else keeps the region sentence and reaches the reader as Athena wrote it. refusalFor in summary-lookup.ts gets the same treatment for an S3 Access Denied. The cases are end to end, with simulated IAM refusing a role that may read Athena and do nothing else through rainlytics query, rainlytics saved-query, a named question given --query, and a summary read.

Resolves #84

  • Conventional commit message, used as the title

  • Conventional branch name, like feat/concise-description

  • Full check with pnpm run check passed

  • Rebased off latest main

  • User-facing behaviour is documented in docs/

See https://www.conventionalcommits.org/en/v1.0.0/

A caller who could not start a query got whatever the SDK threw, with a
sentence about the region on the end. On a permissions failure that
pointed the reader at the one thing that was already right.

`queryRows` now recognises a refusal AWS gave for want of a permission.
It answers with the four actions running a query takes. Those are
athena:StartQueryExecution and athena:StopQueryExecution on the
workgroup, and s3:PutObject and s3:AbortMultipartUpload on the bucket
that workgroup writes results to. #83 measured them.

The message goes on to name the summary path. The five named questions
answer from a precomputed summary on s3:GetObject alone. An identity
refused a query usually still has an answer available, and --summaries
and RAINLYTICS_SUMMARY_BUCKET are where that bucket is named.

The message lives in the command line. `refusalIn` is shared with the
scheduled job, and the job has no summary to offer. A refusal about
anything else keeps the region sentence and reaches the reader as Athena
wrote it.

`refusalFor` in summary-lookup.ts gets the same treatment for an S3
Access Denied. It names s3:GetObject and the bucket, and drops the two
options for finding a bucket somewhere else.

The cases are end to end. Simulated IAM refuses a role that may read
Athena and do nothing else, through `rainlytics query`, `rainlytics
saved-query`, a named question given --query, and a summary read.

Closes #84
The command line page covers the credentials and says nothing about what
the identity behind them has to be allowed. The two halves of the command
surface need different permissions, and the four a query takes are the
ones a read-only role is missing.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 49 minutes.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 89 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ea11701-4b1c-4d6e-9343-c2aa24de3d00

📥 Commits

Reviewing files that changed from the base of the PR and between 55ebd47 and cebdbbf.

📒 Files selected for processing (11)
  • docs/command-line/README.md
  • src/athena/athena-region.ts
  • src/cli/access-refusals.test.ts
  • src/cli/access-refusals.ts
  • src/cli/query-command.test.ts
  • src/cli/query-run.ts
  • src/cli/rollup-commands.test.ts
  • src/cli/saved-query-command.test.ts
  • src/cli/summary-covering.test.ts
  • src/cli/summary-lookup.ts
  • test/reading-athena-caller.ts

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

@hughgrigg
hughgrigg merged commit 6f22067 into main Aug 28, 2026
7 checks passed
@hughgrigg
hughgrigg deleted the feat/name-refused-query-actions branch August 28, 2026 18:11
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.

Name the missing IAM actions when a query is refused

1 participant