Change method of deploying cloud funcs #63
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes the method of deploying cloud funcs to align with CU OIT's preferred permissions setup for GCP, which forces us to do the deployment through a script with the GCP CLI instead of through the web console UI (where it is currently impossible to specify separate service accounts for the build and runtime). As I mention in this comment on PR #62, we're still not doing automatic deployment of this script (yet) since it's very small and unlikely to change.
@jananiravi You'll see in this diff that a
GITHUB_TOKENis required so that an issue can be created on this repo. It also determines what account the issues will be created by. There are basically three methods we can choose from:@jananiraviusername, generate a fine-grain personal access token (PAT) that only has permissions to create issues, and only on this repo. The feedback form would then create issues as if you had created them.@molevolvr-bot, keep track of its login info, and generate a PAT with that. The feedback form would then create issues as the bot account, which we could give a little 🤖 avatar so people know it was automated.1 isn't ideal because your username will get much more notifications (which maybe you want), and it's unclear at first glance (other than the
feedbacklabel that will be auto-added to the created issue) that it was an automated thing.3 is imo overkill for what we are trying to do. It involves more set up, more secrets, and a more involved auth handshake than what we currently have in the
/feedback/index.jsscript. Apps allow more complex things like allowing multiple repos to install it, multiple users to authenticate with it, and acting on behalf of users, when all we really need is issue write permissions for a single repo.Therefore, I recommend option 2. If you're agreeable to that, I can create it, add its username/password to the software team's vault, share it with you so you have ownership access, and do the deploy with its PAT.
Gemini's summary of the benefits of making a GitHub app, with my own commentary
Fine-grained personal access token's alleviate this. They allow, for example, only the ability to write issues to a specific repo.
PATs can be leaked. However we have the
.env.localfile where ours is supposed to be added in.gitignore, and we have GitHub's built-in push secret protection enabled, and if a PAT happens to be committed, we can revoke it immediately.We don't need this.
Option 2 allows us to have a "bot" identity for these cloud functions.