Skip to content

fix: skip cloud tests for dependabot when secrets unavailable#28196

Open
Narwhal-fish wants to merge 4 commits into
trinodb:masterfrom
Narwhal-fish:dependabot-originating-builds-fail-due-to-lack-of-secrets
Open

fix: skip cloud tests for dependabot when secrets unavailable#28196
Narwhal-fish wants to merge 4 commits into
trinodb:masterfrom
Narwhal-fish:dependabot-originating-builds-fail-due-to-lack-of-secrets

Conversation

@Narwhal-fish
Copy link
Copy Markdown

@Narwhal-fish Narwhal-fish commented Feb 9, 2026

Description

Fixes dependabot-originated builds that fail when cloud tests attempt to run without required secrets.

Dependabot can see repository variables but not secrets (unless specifically configured as dependabot secrets). This causes cloud integration tests to execute when vars.AWS_ACCESS_KEY_ID is present, but then fail when secrets.AWS_SECRET_ACCESS_KEY is missing, resulting in "Unable to load AWS credentials from environment variables" errors.

Fixes #28176

The issue was identified through failed dependabot PR builds where the AWS credentials check passed (because dependabot could see the variable), but the actual test execution failed when attempting to load credentials (because the secret was unavailable).

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 9, 2026

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

1 similar comment
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 10, 2026

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@Narwhal-fish Narwhal-fish force-pushed the dependabot-originating-builds-fail-due-to-lack-of-secrets branch from ef3d04f to 945c24f Compare February 12, 2026 18:26
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 12, 2026

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

1 similar comment
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 13, 2026

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@Narwhal-fish Narwhal-fish force-pushed the dependabot-originating-builds-fail-due-to-lack-of-secrets branch from 76fd8cc to 945c24f Compare February 13, 2026 07:39
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 13, 2026

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@Narwhal-fish Narwhal-fish changed the title [WIP] fix: skip cloud tests for dependabot when secrets unavailable fix: skip cloud tests for dependabot when secrets unavailable Feb 14, 2026
@Narwhal-fish Narwhal-fish marked this pull request as ready for review February 14, 2026 14:40
@cla-bot cla-bot Bot added the cla-signed label Feb 22, 2026
@Narwhal-fish Narwhal-fish force-pushed the dependabot-originating-builds-fail-due-to-lack-of-secrets branch 3 times, most recently from e548b80 to 53964d8 Compare February 23, 2026 13:54
@Narwhal-fish Narwhal-fish requested a review from Copilot February 23, 2026 14:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts CI workflow gating so Dependabot-originated runs don’t attempt to execute cloud integration tests when required secrets are unavailable, preventing credential-loading failures in GitHub Actions.

Changes:

  • Updates multiple cloud-test step if: conditions to avoid enabling tests based solely on repo vars when the actor is Dependabot.
  • Updates PT matrix exclusion override for the Azure suite to avoid enabling it based on vars for Dependabot runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
@Narwhal-fish Narwhal-fish force-pushed the dependabot-originating-builds-fail-due-to-lack-of-secrets branch 2 times, most recently from 945c24f to 809ac23 Compare February 23, 2026 15:08
@Narwhal-fish Narwhal-fish marked this pull request as draft February 23, 2026 15:10
@Narwhal-fish Narwhal-fish marked this pull request as ready for review February 23, 2026 15:43
@Narwhal-fish Narwhal-fish requested a review from findepi February 23, 2026 16:51
@findepi findepi requested review from ebyhr and wendigo February 25, 2026 02:25
@ebyhr ebyhr requested a review from Copilot March 2, 2026 00:48
Copy link
Copy Markdown

Copilot AI left a comment

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.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
contains(matrix.modules, 'trino-redshift') &&
(contains(matrix.profile, 'cloud-tests') || contains(matrix.profile, 'fte-tests')) &&
(env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' || env.AWS_ACCESS_KEY_ID != '' || env.REDSHIFT_SUBNET_GROUP_NAME != '')
(env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' || ((env.AWS_ACCESS_KEY_ID != '' || env.REDSHIFT_SUBNET_GROUP_NAME != '') && env.DEPENDABOT_PR != 'true'))
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

The updated Redshift gating skips the step for dependabot PRs even when the run does have secrets (e.g., a repository_dispatch / “test-with-secrets-command” run). Unlike the other AWS-backed steps, this condition no longer has an explicit “secret present” escape hatch, so dependabot PRs can never run Redshift tests even when AWS_SECRET_ACCESS_KEY is available. Adjust the if: to allow execution when the required secret is present (consistent with the (has-var && !dependabot) || has-secret intent).

Suggested change
(env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' || ((env.AWS_ACCESS_KEY_ID != '' || env.REDSHIFT_SUBNET_GROUP_NAME != '') && env.DEPENDABOT_PR != 'true'))
(env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' ||
((env.AWS_ACCESS_KEY_ID != '' || env.REDSHIFT_SUBNET_GROUP_NAME != '') && env.DEPENDABOT_PR != 'true') ||
env.AWS_SECRET_ACCESS_KEY != '')

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines 33 to 36
CI_SKIP_SECRETS_PRESENCE_CHECKS: ${{ secrets.CI_SKIP_SECRETS_PRESENCE_CHECKS }}
SECRETS_PRESENT: ${{ secrets.SECRETS_PRESENT }}
DEPENDABOT_PR: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.client_payload.pull_request.user.login == 'dependabot[bot]' }}
PTL_TMP_DOWNLOAD_PATH: /tmp/pt_java_downloads
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

The new dependabot gating is only applied to some cloud-test steps. There are still steps that gate execution on repo vars (which Dependabot can read) while consuming secrets (which Dependabot can’t), so dependabot-originated runs can still execute and then fail when secrets are empty. Concrete examples in this workflow: the “Run Hive AWS Tests” step runs when AWS_ACCESS_KEY_ID var is set, and “Cloud Snowflake Tests” runs when SNOWFLAKE_URL var is set. Apply the same DEPENDABOT_PR guard (or check required secrets directly) in those places too so this change fully fixes dependabot builds.

Copilot uses AI. Check for mistakes.
@wendigo wendigo requested a review from chenjian2664 March 2, 2026 11:48
@github-actions
Copy link
Copy Markdown

This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack.

@github-actions github-actions Bot added the stale label Mar 23, 2026
@chenjian2664
Copy link
Copy Markdown
Contributor

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 24, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 24, 2026

📝 Walkthrough

Walkthrough

The PR introduces detection for Dependabot-initiated builds by adding a workflow-level DEPENDABOT_PR environment variable that checks if the pull request author is dependabot[bot]. It then updates conditional gating across multiple cloud-related test steps (HDFS, S3, Delta Lake, Iceberg, and Redshift) to prevent these jobs from running on Dependabot PRs when only repository variables are available without corresponding secrets.

Assessment against linked issues

Objective Addressed Explanation
Prevent dependabot-originated builds from failing due to lack of secrets (#28176)

Out-of-scope changes

Code Change Explanation
Added CI_SKIP_SECRETS_PRESENCE_CHECKS environment variable check in job conditions This allows bypassing the Dependabot PR check entirely, which was not mentioned in the proposed solution in #28176 that specified only (has-var && !dependabot-originated) || has-secret. The skip flag adds an additional override mechanism beyond what was requested.

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 771-774: The conditional gating the trino-redshift cloud tests
dropped the AWS secret check and therefore skips Redshift when only
REDSHIFT_AWS_SECRET_ACCESS_KEY is provided (e.g., Dependabot). Update the if
expression that checks matrix.modules == 'trino-redshift' / matrix.profile ==
'cloud-tests'||'fte-tests' to include env.AWS_SECRET_ACCESS_KEY != '' as an
alternative alongside env.AWS_ACCESS_KEY_ID != '' and
env.REDSHIFT_SUBNET_GROUP_NAME != '', preserving the existing
env.CI_SKIP_SECRETS_PRESENCE_CHECKS and env.DEPENDABOT_PR logic so
secrets-provided runs (including Dependabot via secrets) will not be incorrectly
skipped.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 20729cfa-1de3-4205-9ec9-8d40e541feb4

📥 Commits

Reviewing files that changed from the base of the PR and between 8dec32f and 6bb4b69.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +771 to +774
if: >-
contains(matrix.modules, 'trino-redshift') &&
(contains(matrix.profile, 'cloud-tests') || contains(matrix.profile, 'fte-tests')) &&
(env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' || env.AWS_ACCESS_KEY_ID != '' || env.REDSHIFT_SUBNET_GROUP_NAME != '')
(env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' || ((env.AWS_ACCESS_KEY_ID != '' || env.REDSHIFT_SUBNET_GROUP_NAME != '') && env.DEPENDABOT_PR != 'true'))
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Mar 24, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's read the workflow file around lines 771-774
wc -l .github/workflows/ci.yml

Repository: trinodb/trino

Length of output: 1864


🏁 Script executed:

# Read the specific section in question
sed -n '765,780p' .github/workflows/ci.yml

Repository: trinodb/trino

Length of output: 1145


🏁 Script executed:

# Search for other similar Redshift or cloud-test conditions to compare patterns
rg -n "trino-redshift" .github/workflows/ci.yml -A 5 -B 2

Repository: trinodb/trino

Length of output: 2454


🏁 Script executed:

# Also search for AWS_SECRET_ACCESS_KEY checks in the workflow
rg -n "AWS_SECRET_ACCESS_KEY" .github/workflows/ci.yml -B 2 -A 2

Repository: trinodb/trino

Length of output: 5090


Restore the Redshift secret-backed path.

This is the only updated guard that drops env.AWS_SECRET_ACCESS_KEY != ''. All comparable cloud-test gates (hdfs, s3, delta-lake, iceberg) include this check as an alternative. A Dependabot-triggered run with REDSHIFT_AWS_SECRET_ACCESS_KEY configured will still skip Redshift, even though Dependabot secrets are exposed through the secrets context and the step explicitly defines and uses this secret.

Suggested fix
-          (env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' || ((env.AWS_ACCESS_KEY_ID != '' || env.REDSHIFT_SUBNET_GROUP_NAME != '') && env.DEPENDABOT_PR != 'true'))
+          (env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' ||
+            ((env.AWS_ACCESS_KEY_ID != '' || env.REDSHIFT_SUBNET_GROUP_NAME != '') && env.DEPENDABOT_PR != 'true') ||
+            env.AWS_SECRET_ACCESS_KEY != '')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 771 - 774, The conditional gating the
trino-redshift cloud tests dropped the AWS secret check and therefore skips
Redshift when only REDSHIFT_AWS_SECRET_ACCESS_KEY is provided (e.g.,
Dependabot). Update the if expression that checks matrix.modules ==
'trino-redshift' / matrix.profile == 'cloud-tests'||'fte-tests' to include
env.AWS_SECRET_ACCESS_KEY != '' as an alternative alongside
env.AWS_ACCESS_KEY_ID != '' and env.REDSHIFT_SUBNET_GROUP_NAME != '', preserving
the existing env.CI_SKIP_SECRETS_PRESENCE_CHECKS and env.DEPENDABOT_PR logic so
secrets-provided runs (including Dependabot via secrets) will not be incorrectly
skipped.

✅ Confirmed as addressed by @Narwhal-fish

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

OK I'll add the AWS_SECRET_ACCESS_KEY check back.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Narwhal-fish, sounds good! Just to confirm, the updated condition should look like:

(env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' ||
  ((env.AWS_ACCESS_KEY_ID != '' || env.REDSHIFT_SUBNET_GROUP_NAME != '') && env.DEPENDABOT_PR != 'true') ||
  env.AWS_SECRET_ACCESS_KEY != '')

This ensures that Redshift cloud tests can still run when REDSHIFT_AWS_SECRET_ACCESS_KEY is explicitly configured for Dependabot, while also blocking runs where only the variable-backed path (AWS_ACCESS_KEY_ID or REDSHIFT_SUBNET_GROUP_NAME) is visible without the secret.

@github-actions github-actions Bot removed the stale label Mar 24, 2026
@Narwhal-fish Narwhal-fish force-pushed the dependabot-originating-builds-fail-due-to-lack-of-secrets branch from 51d99cc to e842171 Compare March 29, 2026 15:50
Comment thread .github/workflows/ci.yml Outdated
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
CI_SKIP_SECRETS_PRESENCE_CHECKS: ${{ secrets.CI_SKIP_SECRETS_PRESENCE_CHECKS }}
SECRETS_PRESENT: ${{ secrets.SECRETS_PRESENT }}
DEPENDABOT_PR: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.client_payload.pull_request.user.login == 'dependabot[bot]' }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why have condition on github.event.client_payload.pull_request.user.login? Github docs suggest checking github.event.pull_request.user.login (https://docs.github.com/en/code-security/tutorials/secure-your-dependencies/automating-dependabot-with-github-actions#automatically-approving-a-pull-request)
Add condition on github.repository. This shouldn't have effect in forks (also as suggested by github docs).

Copy link
Copy Markdown
Author

@Narwhal-fish Narwhal-fish Mar 30, 2026

Choose a reason for hiding this comment

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

The original reason I used github.event.client_payload.pull_request.user.login was also to support repository_dispatch runs.. I wiil updated it later.

@Narwhal-fish Narwhal-fish force-pushed the dependabot-originating-builds-fail-due-to-lack-of-secrets branch 4 times, most recently from 8d18519 to 8b6032a Compare April 6, 2026 08:46
Allow Redshift tests to run when only AWS_SECRET_ACCESS_KEY is available
(e.g., when configured as a Dependabot secret), matching the pattern
used by other cloud-test gates (HDFS, S3, Delta Lake, Iceberg).
@Narwhal-fish Narwhal-fish force-pushed the dependabot-originating-builds-fail-due-to-lack-of-secrets branch from 8b6032a to bc7ad66 Compare April 6, 2026 08:52
@github-actions
Copy link
Copy Markdown

This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack.

@github-actions github-actions Bot added the stale label Apr 27, 2026
@github-actions github-actions Bot removed the stale label May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

dependabot-originating builds fail due to lack of secrets

4 participants