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

Make GitHub environment Scaffolder action use auth to resolve reviewers #27796

Conversation

stegosaurus21
Copy link
Contributor

Hey, I just made a Pull Request!

Changes the github:environment:create Scaffolder action to request and use a backend auth token when resolving the reviewer entityRefs from the Backstage catalog.

This is because previously it would throw a 401 error when backend auth was not disabled.

The logic for requesting the token is copied from the existing catalog:fetch action, which needs to do a similar thing.

Also slightly clarifies that Backstage entityRefs are expected in the reviewers list for this action.

Fixes #27515.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@stegosaurus21 stegosaurus21 requested review from a team as code owners November 23, 2024 09:41
@github-actions github-actions bot added the area:scaffolder Everything and all things related to the scaffolder project area label Nov 23, 2024
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Nov 23, 2024

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-scaffolder-backend-module-github plugins/scaffolder-backend-module-github patch v0.5.4-next.1

Changes the github:environment:create Scaffolder action to request and
use a backend auth token when resolving the reviewer entityRefs from the
Backstage catalog.

This is because previously it would throw a 401 error when backend auth
was not disabled.

The logic for requesting the token is copied from the existing
catalog:fetch action, which needs to do a similar thing.

Also slightly clarifies that Backstage entityRefs are expected in the
reviewers list for this action.

Signed-off-by: Jason Liu <a.jason.liu21@gmail.com>
@stegosaurus21 stegosaurus21 force-pushed the stegosaurus21/fix-create-github-env-auth branch from bd8abb1 to b5e002b Compare November 23, 2024 09:58
@benjdlambert
Copy link
Member

I think that you will also need to pass through the AuthService here:

Signed-off-by: Jason Liu <a.jason.liu21@gmail.com>
@stegosaurus21 stegosaurus21 force-pushed the stegosaurus21/fix-create-github-env-auth branch from 3baec71 to 2a9bd22 Compare December 5, 2024 11:22
Copy link
Member

@benjdlambert benjdlambert left a comment

Choose a reason for hiding this comment

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

Thanks for this! 🎉

@benjdlambert benjdlambert merged commit bc018aa into backstage:master Dec 13, 2024
23 checks passed
Copy link
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.34.0 release, scheduled for Tue, 17 Dec 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:scaffolder Everything and all things related to the scaffolder project area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Scaffolder action 'github:environment:create' throws 401 when reviewer is specified
2 participants