Skip to content

chore: reuse function from whoowns package#93

Merged
hofbi merged 5 commits intohofbi:masterfrom
cbachhuber:fix/reuse-function-from-whoowns-package
Apr 1, 2026
Merged

chore: reuse function from whoowns package#93
hofbi merged 5 commits intohofbi:masterfrom
cbachhuber:fix/reuse-function-from-whoowns-package

Conversation

@cbachhuber
Copy link
Copy Markdown

As agreed in #90

GithubOwnerShip,
OwnerShipEntry,
check_git,
get_codeowners_path,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Oh, looks like I missed something. I though we remove this function entirely and instead use find_codeowners_file exclusively.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That's a good idea. I'd also prefer to move find_codeowners_file to ownership_utils. That of course breaks the e2e tests in this PR. Do you think that that move makes sense?

Copy link
Copy Markdown
Owner

@hofbi hofbi Apr 1, 2026

Choose a reason for hiding this comment

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

yes, let's move it. we probably need to disable again, release, and enable.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Cool, already done and the e2e test fails as expected.

As an alternative, can we mark the e2e test as not required and merge with a red test? That would actually more transparently show what's going on and require less editing and reverting.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

ok, let's make this check optional. maybe we can find a better solution at some point.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Do you want to make it optional or should we make this a separate PR?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Isn't this a GitHub GUI setting for the repo? I.e., defining which job is required and which one isn't?

I don't think that there's something like allow-failure for GitHub actions, see actions/runner#2347

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

That feels ugly. We could also put the check-ownership hook into

run: SKIP=check-jira-reference-in-todo,go-revive,go-fmt,go-imports,check-number-of-lines-count uvx ${{ matrix.tool }} try-repo "$PWD" --all-files --verbose
again. Maybe we need to find a better way to use try-repo at some point so that we can test all hooks independent of our actual code.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

True, that's possible, done.

And I agree, an alternative would be good. I'd also appreciate if we had a test that consumes whoowns from this repo and not from pypi, to not repeatedly run into this issue. I still think that we should also have a full e2e test that creates the hooks as if they were used on another repo, but maybe that's manual, allowed to fail (one can always do <possibly_failing_cmd> || true) or run on tags only. What do you think?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

We could have a list of gating and non gating try-repo calls. No gating by || true.

@hofbi hofbi merged commit 3d3a268 into hofbi:master Apr 1, 2026
8 checks passed
@hofbi hofbi mentioned this pull request Apr 1, 2026
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.

2 participants