Skip to content

Conversation

@Kobzol
Copy link
Member

@Kobzol Kobzol commented Nov 21, 2025

The inner context is not actually printed by sync-team, so it was swallowed. Found in https://github.com/rust-lang/team/actions/runs/19570968459/job/56044145703?pr=2101.

@github-actions
Copy link

Dry-run check results

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

jieyouxu
jieyouxu previously approved these changes Nov 24, 2025
@jieyouxu jieyouxu added needs-infra-admin-review This change requires one of the `infra-admins` to review. S-waiting-on-review Status: waiting on review from a team/WG/PG lead, an infra-admin, and/or a team-repo-admin. labels Nov 24, 2025
@marcoieni
Copy link
Member

marcoieni commented Nov 24, 2025

Imo the actual fix is to change this line:

error!("validation error: {err}");

to error!("validation error: {err:?}");

so that the error context is printed

:? should be used everywhere we print anyhow errors probably

@Kobzol
Copy link
Member Author

Kobzol commented Nov 24, 2025

Well, we use anyhow errors, so the Debug output will include all kind of crap, possibly even backtraces. I kind of like the single-line error messages that we have right now. Maybe the verbose output could be optional with -v or something.

@marcoieni
Copy link
Member

this is how the error would look like.

It doesn't contain crap, but the context of all the errors.

Why wouldn't we want to print the error context?

@Kobzol
Copy link
Member Author

Kobzol commented Nov 24, 2025

Ok, I tried it and it's better than I thought :) I don't understand why there's no backtrace, anyhow should normally capture it and print it. Anyway, I pushed an alternative implementation based on what you suggested, this is how it would look like:

[ERROR rust_team::validate] validation error: Access for the repo rust-lang/wg-security-response is invalid
    
    Caused by:
        The file 'teams/foo-security-response.toml' does not exist.

@Kobzol Kobzol changed the title Provide better error message for repository access validation Make validation error messages more verbose Nov 24, 2025
@marcoieni
Copy link
Member

I don't understand why there's no backtrace, anyhow should normally capture it and print it.

mmmh maybe you need to enable it as a feature? Never saw backtraces in anyhow

@marcoieni marcoieni added this pull request to the merge queue Nov 24, 2025
@Kobzol
Copy link
Member Author

Kobzol commented Nov 24, 2025

No it's enabled by default. I just forgot that RUST_BACKTRACE needs to be set to see it :) Nevermind.

Merged via the queue into rust-lang:main with commit 0d7c27b Nov 24, 2025
3 checks passed
@Kobzol Kobzol deleted the validate-error branch November 24, 2025 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-infra-admin-review This change requires one of the `infra-admins` to review. S-waiting-on-review Status: waiting on review from a team/WG/PG lead, an infra-admin, and/or a team-repo-admin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants