Skip to content

OSAC-1568: Add e2e-test GitHub environment to osac-test-infra#107

Merged
eliorerz merged 1 commit into
osac-project:mainfrom
eliorerz:OSAC-1568-e2e-test-environments
Jun 18, 2026
Merged

OSAC-1568: Add e2e-test GitHub environment to osac-test-infra#107
eliorerz merged 1 commit into
osac-project:mainfrom
eliorerz:OSAC-1568-e2e-test-environments

Conversation

@eliorerz

@eliorerz eliorerz commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add an environments variable to the common_repository module
  • Create an e2e-test environment on osac-test-infra

Why

E2e tests need secrets (cluster credentials, API tokens) from our local Vault instance on the CI runner. GitHub environments let workflows request OIDC tokens with an environment claim, so Vault can restrict secret access to only workflows running in e2e-test — rather than allowing any workflow in the org.

Other repos (fulfillment-service, osac-operator, etc.) will be onboarded in a follow-up PR once the full flow is validated on osac-test-infra.

Test plan

Summary by CodeRabbit

  • Chores
    • Added repository environment management capabilities with support for deployment protections, reviewer controls, and conditional branch policies for the e2e-test environment.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@eliorerz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 12 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: b1f887f2-e7e5-4796-974a-f732b8b507a9

📥 Commits

Reviewing files that changed from the base of the PR and between 3c3a968 and 9009fa6.

📒 Files selected for processing (3)
  • modules/common_repository/main.tf
  • modules/common_repository/variables.tf
  • repositories.tf

Walkthrough

Adds GitHub repository environment management to the common_repository Terraform module. A new environments input variable defines a list of environment objects with optional reviewer and deployment branch policy configuration. A new github_repository_environment resource iterates over that variable. One e2e-test environment is immediately wired into repo_osac_test_infra.

Changes

GitHub Repository Environments Support

Layer / File(s) Summary
environments variable and resource implementation
modules/common_repository/variables.tf, modules/common_repository/main.tf
Defines the environments input variable (list of objects with required name, optional reviewers with teams/users lists, optional deployment_branch_policy with protected_branches/custom_branch_policies booleans, defaulting to []). Adds the github_repository_environment resource iterating via for_each over that variable, using dynamic blocks for conditional reviewer and deployment branch policy configuration, with an explicit depends_on to github_repository.repo.
Wire e2e-test environment to repo_osac_test_infra
repositories.tf
Adds environments = [{ name = "e2e-test" }] to the repo_osac_test_infra module call, exercising the new variable with a minimal entry.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🌿 A new environment blooms in the repo's care,
e2e-test declared with a minimal flair.
Dynamic blocks guard the reviewers' gate,
Branch policies optional — configure or wait.
Terraform iterates, the environments align,
Each for_each key a neat little shrine. 🔑

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a GitHub environment named 'e2e-test' to the osac-test-infra repository, with an issue reference.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed No hardcoded secrets detected. PR adds GitHub environments module support and e2e-test environment—contains only non-sensitive infrastructure configuration (environment names, team IDs, deployment...
No-Weak-Crypto ✅ Passed This PR adds Terraform configuration for GitHub environments; it contains no cryptographic code or weak crypto patterns (MD5, SHA1, DES, RC4, etc.).
No-Injection-Vectors ✅ Passed Pure Terraform/HCL code with no SQL concatenation, shell injection, eval/exec, unsafe yaml/pickle, os.system, or dangerouslySetInnerHTML patterns detected.
Container-Privileges ✅ Passed PR contains only Terraform infrastructure-as-code (GitHub environments, repositories, teams). No container/K8s manifests or privileged configurations present; check is not applicable.
No-Sensitive-Data-In-Logs ✅ Passed No logging of sensitive data found. The PR only adds a github_repository_environment resource that sets non-sensitive metadata (environment name, reviewers, branch policies) with no outputs or logg...
Ai-Attribution ✅ Passed No AI tool usage mentioned in PR description or commit message; no AI-related trailers (Assisted-by, Generated-by, Co-Authored-By) present in commit metadata.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modules/common_repository/variables.tf`:
- Around line 134-148: Add two validation blocks to the environments variable
definition to catch issues at the module boundary. The first validation block
should ensure all environment names are non-empty strings by checking that no
element in the list has a blank name value. The second validation block should
ensure all environment names are unique by verifying that the count of distinct
names equals the total count of environments. Both validations should reference
the environments variable and provide clear error messages that explain why the
validation failed, since the for_each loop in main.tf at lines 106-108 uses
env.name as the key and will fail with duplicate-key or provider-time errors if
these constraints are violated.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: f5ee98eb-3bac-443f-b707-5b4653d68df3

📥 Commits

Reviewing files that changed from the base of the PR and between 616e8b1 and 3c3a968.

📒 Files selected for processing (3)
  • modules/common_repository/main.tf
  • modules/common_repository/variables.tf
  • repositories.tf

Comment thread modules/common_repository/variables.tf
Add environment support to the common_repository module and create
an e2e-test environment on osac-test-infra. This environment will
be used by e2e workflows to authenticate to Vault via GitHub OIDC
and retrieve test secrets.
@eliorerz eliorerz force-pushed the OSAC-1568-e2e-test-environments branch from 062b52e to 9009fa6 Compare June 18, 2026 16:05
@eliorerz eliorerz merged commit 55f9976 into osac-project:main Jun 18, 2026
2 checks passed
@eliorerz eliorerz deleted the OSAC-1568-e2e-test-environments branch June 18, 2026 16:41
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