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

Unknown email list error when requesting removal of a subset of a previous rejected PR #325

Open
monotypical opened this issue Apr 4, 2024 · 1 comment

Comments

@monotypical
Copy link

I requested the removal of some accounts of people who have left PaaS. This resulted in alphagov/aws-user-management-account-users#1666.

It was then pointed out that one of the people included in the PR is still working with GDS, so that PR was closed.

I then attempted to re-request the removal with the person who is still with GDS excluded, and received the following error from the form:

There is a problem
Email list unknown error when opening pull request or sending email

Screenshot 2024-04-04 at 14 17 50
(email addresses redacted from the above screenshot)

I would expect that submitting this second request with a subset of users from the first request would succeed, and result in a second pull request, or at least a more descriptive error if I'm doing something wrong.

@stephengrier
Copy link
Contributor

This issue occurs when two requests are made to add or remove the same user or users. The request-an-aws-account app creates a git branch using a predictable name format eg remove-aws-user-bob-smith-and-friends. When a second request is made for the same user, the request-an-aws-account app tries to create a git branch with the same name, which fails with an error like:

Failed to create branch remove-aws-user-bob-smith-and-friends. Perhaps there’s already a branch with that name?

This error is handled by the create_branch function in the GithubService class, but the app ignores the presence of the error and proceeds with making a call to the Oktokit contents function, which results in an error like:

PUT https://api.github.com/repos/alphagov/aws-user-management-account-users/contents/terraform/gds_users.tf.json: 409 - terraform/gds_users.tf.json does not match 21441be5869329b6d0b63341df20dc5118986573 // See: https://docs.github.com/rest/repos/contents#create-or-update-file-contents

I think the correct fix for this is to change the GithubService class to correctly handle errors from the create_branch call and return a helpful message to the user describing what has likely happened and possibly to check for another request for the same user(s).

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

No branches or pull requests

2 participants