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

Add remote bazel integration test #6411

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

maggie-lou
Copy link
Contributor

Related issues: N/A

@maggie-lou maggie-lou force-pushed the rb_integration_test branch 22 times, most recently from c4102a0 to f737538 Compare April 19, 2024 20:24
@maggie-lou maggie-lou force-pushed the rb_integration_test branch 8 times, most recently from 82fddff to fecc1a8 Compare May 6, 2024 20:22
@maggie-lou maggie-lou force-pushed the rb_integration_test branch 7 times, most recently from 999f0eb to b529339 Compare May 8, 2024 18:13
@maggie-lou maggie-lou changed the title [WIP] Add remote bazel integration test Add remote bazel integration test May 8, 2024
@maggie-lou maggie-lou marked this pull request as ready for review May 8, 2024 18:14
@maggie-lou maggie-lou force-pushed the rb_integration_test branch 2 times, most recently from 8db10f5 to b9dcc8c Compare May 8, 2024 20:46
@maggie-lou maggie-lou requested a review from bduffany May 8, 2024 20:48
@maggie-lou maggie-lou force-pushed the rb_integration_test branch 2 times, most recently from 0d1ce3f to 3451788 Compare May 13, 2024 20:24
Comment on lines 103 to 104
repoName := "private-test-repo"
username := "maggie-lou"
Copy link
Member

Choose a reason for hiding this comment

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

can you move this to the buildbuddy-io org?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The repo is under the buildbuddy org, the token is under my account (you can't create a PAT for an org, but I could create a dummy account)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Decided that it will probably be more annoying to track a password for a service account. Anyone can re-generate this PAT if they need, even if I leave the company and we can't access this token or something

server/testutil/testgit/testgit.go Outdated Show resolved Hide resolved
server/testutil/testgit/testgit.go Outdated Show resolved Hide resolved
// This token grants read-only access to a private dummy repo.
// Github will invalidate tokens that are committed, so format it so that Github
// won't catch it.
personalAccessToken := fmt.Sprintf("github_pat_%s", "11ADKOFLI06Ob3cnrygcQa_gwLj0orOD3EILEu2k9pJ9EUkmXW6uM0k47k0uPOWInCDPHNC444JmQ8oN62")
Copy link
Member

Choose a reason for hiding this comment

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

I think we should avoid checking in access tokens, even though it only grants access to an empty repo - could you use the gh app token env var that is already passed to the workflow, so that this authenticates as the app installation rather than a person?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you explain more what you're describing? This is a /buildbuddy repo test, so are you describing the /buildbuddy app token?

Also as a somewhat related note - I was playing around with accessing BB secrets from within a go test, and the only way I could get it to work was if I added --test_env=SECRET_NAME to the bazel command in buildbuddy.yaml. This passes the secret to all the tests, which may not be ideal (may be okay in this case, but could get messy if a lot of tests need to reference different secrets)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored to pull PAT from a secret (Also deleted the old PAT that was in our git history)

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.

None yet

2 participants