-
Notifications
You must be signed in to change notification settings - Fork 299
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
improve repo validation error message #1764
base: master
Are you sure you want to change the base?
Conversation
945be99
to
a60dd9d
Compare
src/validate.rs
Outdated
@@ -868,20 +868,26 @@ fn validate_repos(data: &Data, errors: &mut Vec<String>) { | |||
} | |||
for team_name in repo.access.teams.keys() { | |||
if !github_teams.contains(&(repo.org.clone(), team_name.clone())) { | |||
let is_team_archived = data.archived_teams().any(|t| t.name() == team_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should start taking organizations into account :) Ideally by creating some form of Team/RepoId
, which contains both the org and the name. To avoid naming collisions across different organizations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right. Can this be a separate issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but I would rather not add new code that doesn't consider organizations. There's a possibly bigger problem here though, as you should check the github team name (and organization), not the team
team name (yeah, it's confusing.. xD).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, because access.teams
refers to github team names, not team
team names xD
Dry-run check results
|
a60dd9d
to
d13f963
Compare
The new version of the validation error is still not very clear to me (that I don't know a lot about the How about this:
|
d13f963
to
d482fcb
Compare
rephrased, thanks a lot! This kind of feedback is very useful 🙏 |
@@ -868,20 +868,25 @@ fn validate_repos(data: &Data, errors: &mut Vec<String>) { | |||
} | |||
for team_name in repo.access.teams.keys() { | |||
if !github_teams.contains(&(repo.org.clone(), team_name.clone())) { | |||
let error_reason = if data.is_team_archived(team_name, &repo.org) { | |||
"is archived. Please remove the team access from the `[access.teams]` section of the repo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if something like this wouldn't be even easier to understand. Might require a change to the data model, though, to deserialize a repository without the access.teams
field set. 🤔
"is archived. Please remove the team access from the `[access.teams]` section of the repo" | |
"is archived. Please remove the `[access.teams]` section in the repo's toml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change sounds more like #1754
Why should we suggest removing the entire [access.teams]
section of the repo here?
That particular team is archived, but not the repo.
A user complained in #1763 (comment) that this error was confusing.
tested against that PR: