Skip to content

fix: Preserve environment settings during fallback - #4728

Open
LionStone-1 wants to merge 1 commit into
google:masterfrom
LionStone-1:contribpilot/issue-4727-environment-fallback
Open

LionStone-1 wants to merge 1 commit into
google:masterfrom
LionStone-1:contribpilot/issue-4727-environment-fallback

Conversation

@LionStone-1

Copy link
Copy Markdown

Fixes #4727.

Preserve explicitly supplied can_admins_bypass values, including false, in the reduced environment-update request after a 422 response. Return the original error when prevent_self_review=true would otherwise be discarded, following the issue's proposed alternative.

Regression tests exercise the public client, omitted and explicit boolean values, branch-policy preservation, and fallback refusal for requested protections. The new cases failed before the fix.

Validation on the current master base:

  • Root-module go test ./... -count=1 passed.
  • go vet ./github passed.
  • Focused environment tests with -race passed.
  • Formatting and whitespace checks passed.

Live Team-plan API behavior, nested example modules, and custom generation/lint scripts were not tested.

Codex assisted with implementation, regression tests, review, verification, and this description. The contributor personally reviewed and understood the patch.

@google-cla

google-cla Bot commented Nov 22, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@LionStone-1
LionStone-1 marked this pull request as ready for review November 22, 2026 13:07
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Nov 22, 2026
@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (5c5bbe8) to head (2ef5b77).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4728   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files         204      204           
  Lines       19162    19163    +1     
=======================================
+ Hits        18902    18903    +1     
  Misses        260      260           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please fix the CLA issue and the linter issue, then we can proceed with a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging. waiting for signed CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CreateUpdateEnvironment drops can_admins_bypass and prevent_self_review in the non-Enterprise fallback

2 participants