Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADO: Change full checkout persistCredentials default back to false #10553

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

jonthysell
Copy link
Contributor

@jonthysell jonthysell commented Sep 12, 2022

Description

A change in beachball behavior means we need to make sure we have (the right) credentials ready to run beachball commands in our various ADO pipelines.

I made some temporary workarounds to unblock pipelines:

This PR updates our pipelines to use the most appropriate credentials for the tasks they need to run.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Why

The temporary workarounds made all "full checkouts" in ADO persist the credentials used to checkout the repo, but that will override using any other credentials later in the pipeline.

In the case of publish, we actually need rnbot's admin credentials, so the publish pipeline reverts to the previous behavior of no longer persisting creds at checkout and instead configuring for rnbot's creds.

However, many other tasks do trivial/temporary local repo operations using rnbot's credentials. This is an unnecessary (and potentially risky) elevation that we shouldn't do anymore.

What

This PR sets "full checkouts" back to not persisting credentials by default, because most tasks don't need them. Then, in the places where we do need credentials for later git/beachball commands, we choose from this prioritized list:

  1. If possible, set persistCredentials to true, and use the (less-powerful) credentials
  2. Otherwise, and only if the tasks require it, continue using rnbot's credentials
Microsoft Reviewers: Open in CodeFlow

@jonthysell jonthysell changed the title ADO: Change full checkout persistCredentials default to false ADO: Change full checkout persistCredentials default back to false Sep 12, 2022
@jonthysell jonthysell added security Pull requests that address a security vulnerability Area: Build Infrastructure labels Sep 12, 2022
A change in beachball behavior means we need to make sure we have (the
right) credentials ready to run beachball commands in our various ADO
pipelines.

I made some temporary workarounds to unblock pipelines:

- [Add persistCredentials: true to
  checkout](microsoft@ba5b008)
- [Update publish.yml to not set credentials until after running
  credscan](microsoft@19ef068)
- [Parameterize persistCredentials, default to
  true](microsoft@462407c)
- [Update publish.yml to not persist
  credentials](microsoft@8f60783)

This PR updates our pipelines to use the most appropriate credentials
for the tasks they need to run.

- Bug fix (non-breaking change which fixes an issue)

The temporary workarounds made **all** "full checkouts" in ADO persist
the credentials used to checkout the repo, but that will override using
any other credentials later in the pipeline.

In the case of publish, we actually need rnbot's admin credentials, so
the publish pipeline reverts to the previous behavior of no longer
persisting creds at checkout and instead configuring for rnbot's creds.

However, many other tasks do trivial/temporary local repo operations
using rnbot's credentials. This is an unnecessary (and potentially
risky) elevation that we shouldn't do anymore.

This PR sets "full checkouts" back to not persisting credentials by
default, because most tasks don't need them. Then, in the places where
we do need credentials for later git/beachball commands, we choose from
this prioritized list:

1. If possible, set `persistCredentials` to `true`, and use the
   (less-powerful) credentials
2. Otherwise, and only if the tasks require it, continue using rnbot's
   credentials

N/A

If you added tests that prove your changes are effective or that your
feature works, add a few sentences here detailing the added test
scenarios.
@jonthysell jonthysell marked this pull request as ready for review September 12, 2022 21:46
@jonthysell jonthysell requested review from a team as code owners September 12, 2022 21:46
@jonthysell jonthysell added the AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity) label Sep 12, 2022
@ghost
Copy link

ghost commented Sep 12, 2022

Hello @jonthysell!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 10 hours, a condition that will be fulfilled in about 8 hours 22 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@jonthysell
Copy link
Contributor Author

The beachball issue that precipitated these changes: microsoft/beachball#674

@jonthysell jonthysell merged commit aff880d into microsoft:main Sep 13, 2022
@jonthysell jonthysell deleted the creddefault branch September 13, 2022 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Build Infrastructure AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity) security Pull requests that address a security vulnerability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant