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

improve repo validation error message #1764

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcoieni
Copy link
Member

@marcoieni marcoieni commented Apr 4, 2025

A user complained in #1763 (comment) that this error was confusing.

tested against that PR:

$ GITHUB_TOKEN=$(gh auth token) rust-team check                                                                  
[WARN  rust_team::validate] couldn't perform checks relying on the Zulip API, some errors will not be detected
[WARN  rust_team::validate] cause: missing ZULIP_USER and/or ZULIP_TOKEN environment variables
[ERROR rust_team::validate] validation error: Access for the repo rust-lang/wg-debugging is invalid: the team 'rust-lang/wg-debugging' is archived. Please remove it from the repo.
[ERROR rust_team] 1 validation errors found

@marcoieni marcoieni force-pushed the improve-repo-validation-error-message branch 2 times, most recently from 945be99 to a60dd9d Compare April 4, 2025 11:35
@marcoieni marcoieni marked this pull request as ready for review April 4, 2025 11:38
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);
Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Contributor

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).

Copy link
Member Author

Choose a reason for hiding this comment

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

you mean I should check the github field?

pub org: String,

Copy link
Contributor

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

Copy link

github-actions bot commented Apr 4, 2025

Dry-run check results

[WARN  sync_team] sync-team is running in dry mode, no changes will be applied.
[INFO  sync_team] synchronizing github

@marcoieni marcoieni force-pushed the improve-repo-validation-error-message branch from a60dd9d to d13f963 Compare April 4, 2025 14:25
@apiraino apiraino mentioned this pull request Apr 4, 2025
@apiraino
Copy link
Contributor

apiraino commented Apr 4, 2025

Access for the repo rust-lang/wg-debugging is invalid: the team 'rust-lang/wg-debugging' is archived. Please remove it from the repo.

The new version of the validation error is still not very clear to me (that I don't know a lot about the team repository). What should I remove? Which repo? I've deleted this line and the validation now pass but I can't correlate my change to the validation error message.

How about this:

Access for the repo rust-lang/wg-debugging is invalid: the team 'rust-lang/wg-debugging' is archived. Please remove the team access from the [access.teams] section.

@marcoieni marcoieni force-pushed the improve-repo-validation-error-message branch from d13f963 to d482fcb Compare April 7, 2025 14:47
@marcoieni
Copy link
Member Author

rephrased, thanks a lot! This kind of feedback is very useful 🙏

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

Successfully merging this pull request may close these issues.

3 participants