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

Feature request: throw an error if one (or more) assignees cannot be assigned to an issue? #148

Closed
eri-trabiccolo opened this issue Dec 18, 2024 · 8 comments

Comments

@eri-trabiccolo
Copy link

Would that be possible? Maybe with an option to enabled this check?
What do you think?

https://docs.github.com/en/rest/issues/assignees?apiVersion=2022-11-28#check-if-a-user-can-be-assigned-to-a-issue

@pozil
Copy link
Owner

pozil commented Dec 27, 2024

Hi @eri-trabiccolo, thanks for the suggestion. Sure, it's feasible.
Can you share a bit more about your use case? I'm curious about how this new behavior would help you more than the current implementation.

@eri-trabiccolo
Copy link
Author

Hi @pozil thanks for taking care about this.
Here's my scenario:
In my company we have a bunch of private repositories whit different codeowners. We have a github action in place that reads the repo's CODEOWNER file and assignes any new issues to the primary codeowner defined in that file.
When these codeowners leave the company they also lose the access on the repositories, of course, so when a new issue is opened the gh action tries to assign it to them but, since the issue can't be assigned, it silently fails (no error thrown). I'd just like an error to be thrown, that would act like a reminder to change the codeowner.

Let me know if you need more details.
Thanks!

@pozil
Copy link
Owner

pozil commented Jan 2, 2025

Hi @eri-trabiccolo, happy new year and thanks for sharing the use case. I've implemented the extra check in the latest release.
You'll want to set the failsIfUsersCannotBeAssigned flag to true to trigger this behavior (I didn't want to introduce a breaking change).

@pozil pozil closed this as completed Jan 2, 2025
@eri-trabiccolo
Copy link
Author

Hey @pozil thanks and happy new year to you too!

I've implemented the extra check in the latest release.
You'll want to set the failsIfUsersCannotBeAssigned flag to true to trigger this behavior (I didn't want to introduce a breaking change).

That's awesome thanks! I just tested it and didn't work though:

screenshot-20250102_164801_066625438

It says the flag you suggested is not expected :)

@pozil pozil reopened this Jan 2, 2025
@pozil
Copy link
Owner

pozil commented Jan 2, 2025

My bad, I forgot to add the flag to the action descriptor.
Can you try v2.1.1 and let me know if it works as expected?

@eri-trabiccolo
Copy link
Author

@pozil thanks!
I did try using a github handler which doesn't exist, but I didn't get any errors

screenshot-20250102_181340_021381745

@pozil
Copy link
Owner

pozil commented Jan 3, 2025

Thanks for your patience @eri-trabiccolo, I identified and fixed the issue. Can you try v2.1.2?

@eri-trabiccolo
Copy link
Author

Hey @pozil
thanks!
Works fine, thanks again!

@pozil pozil closed this as completed Jan 3, 2025
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