Skip to content

improve repo validation error message - #1764

Merged
marcoieni merged 1 commit into
masterfrom
improve-repo-validation-error-message
Apr 30, 2025
Merged

marcoieni merged 1 commit into
masterfrom
improve-repo-validation-error-message

Conversation

@marcoieni

@marcoieni marcoieni commented Apr 4, 2025 •

Copy link
Copy Markdown
Member

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
Comment thread src/validate.rs Outdated
}
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
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member

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

@github-actions

github-actions Bot commented Apr 4, 2025

Copy link
Copy Markdown
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

apiraino commented Apr 4, 2025 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member Author

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

Comment thread src/validate.rs
@marcoieni
marcoieni requested a review from jdno April 29, 2025 12:45

@jdno jdno left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM :shipit:

@marcoieni
marcoieni added this pull request to the merge queue Apr 30, 2025
Merged via the queue into master with commit 5c6c007 Apr 30, 2025
@marcoieni
marcoieni deleted the improve-repo-validation-error-message branch April 22, 2026 16:07
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.

4 participants