Skip to content

Request: Lint for mentors syntax as part of a dry-run #29

Description

@joestringer

This code describes that some linter will fail if mentors are not part of members:

// Note 1: Mentors _must_ be in the member list. Lint will warn if they are not

The relevant code appears to be here, but it actually only checks if the person is a member of the organization:

fmt.Printf("[ERROR] mentor %q from team %s, not found in the list of team members in the organization\n", member, teamName)

This code should:

  1. Also check that the mentor is a member of the specific team, in addition to being a member of the org
  2. Return an error up the stack so that the error can prevent silent success
  3. Eventually print the error to stderr, not stdout
  4. Report the failure to the user when dry-run flag is provided
  5. Be available as part of a linter without running a 'push' command

I found this out because I made this "wrong syntax" in the following PR:

cilium/community#235

The dry-run for applying these settings did not complain:

https://github.com/cilium/team-management/actions/runs/15142421235/job/42569714896#step:7:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions