Skip to content

Conversation

@josecolella
Copy link

Context

The message indicates to the user to run generate

❯ bin/codeownership generate
'generate' is not a code_ownership command. See `bin/codeownership help`.

the command to run seems to be

❯ bin/codeownership validate

let mut current_section: Option<TeamOwnership> = None;
let input: String = codeowners_file.replace(&FileGenerator::disclaimer().join("\n"), "");
let error_message = "CODEOWNERS out of date. Run `codeowners generate` to update the CODEOWNERS file";
let error_message = "CODEOWNERS out of date. Run `codeownership validate` to update the CODEOWNERS file";
Copy link
Contributor

Choose a reason for hiding this comment

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

codeowners generate is correct for codeowners-rs, but not for the ruby gem code_ownership that wraps it.

We'll likely need to at least update code_ownership to fix this bug and possibly rethink how errors are handled in the ruby to rust FFI.

Copy link
Author

Choose a reason for hiding this comment

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

Sounds good. How would I be able to update this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Possibilities:

  • Make the error message generic "CODEOWNERS out of date. Regenerate the CODEOWNERS file to fix."
  • Update RunResult to include error codes, which could be used by code_ownership to customize error messages
  • Temporary solution: the gem post-processes the output: gsub codeowners generate with bin/codeownership validate
  • ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants