Skip to content

temp: run community PR tests#250

Merged
2 commits merged into
mainfrom
pr-229
May 29, 2026
Merged

temp: run community PR tests#250
2 commits merged into
mainfrom
pr-229

Conversation

@scott-ray-wilson
Copy link
Copy Markdown
Contributor

Description 📣

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@infisical-review-police
Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-cli-250-temp-run-community-pr-tests

Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR adds support for reading projectId from the INFISICAL_PROJECT_ID environment variable as a fallback when the --projectId flag is not explicitly provided on the command line. The change is applied uniformly across all affected commands.

  • A new constant INFISICAL_PROJECT_ID_NAME = \"INFISICAL_PROJECT_ID\" is added to constants.go, and all 15 call sites across 7 command files are updated to use the existing GetCmdFlagOrEnvWithDefaultValue helper.
  • The helper falls through: CLI flag → env var → empty string default, which maintains backward compatibility — no existing behavior is broken.

Confidence Score: 5/5

Straightforward, low-risk change that adds env-var fallback for projectId across CLI commands with no behavioural change when the flag is already provided.

All 15 call sites are updated consistently, the helper function is already well-tested elsewhere in the codebase, and the fallback to an empty string preserves existing validation logic downstream. No security, correctness, or interface-breaking concerns were found.

No files require special attention.

Important Files Changed

Filename Overview
packages/util/constants.go Adds INFISICAL_PROJECT_ID_NAME constant for the new environment variable support
packages/cmd/dynamic_secrets.go Replaces direct flag reads with GetCmdFlagOrEnvWithDefaultValue for projectId across 5 sub-commands
packages/cmd/secrets.go Replaces direct flag reads with GetCmdFlagOrEnvWithDefaultValue for projectId across 5 sub-commands
packages/cmd/run.go Replaces direct flag read with GetCmdFlagOrEnvWithDefaultValue for projectId
packages/cmd/export.go Replaces direct flag read with GetCmdFlagOrEnvWithDefaultValue for projectId
packages/cmd/folder.go Replaces direct flag reads with GetCmdFlagOrEnvWithDefaultValue for projectId across 3 sub-commands
packages/cmd/ssh.go Replaces direct flag read with GetCmdFlagOrEnvWithDefaultValue for projectId in sshAddHost
packages/cmd/tokens.go Replaces direct flag read with GetCmdFlagOrEnvWithDefaultValue for projectId in tokensCreateCmd

Reviews (1): Last reviewed commit: "fix: remove generic PROJECT_ID fallback ..." | Re-trigger Greptile

@scott-ray-wilson scott-ray-wilson closed this pull request by merging all changes into main in b942fee May 29, 2026
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.

2 participants