Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup GitHub Actions formatter when run in non-default directory #9933

Merged
merged 1 commit into from Jul 16, 2021

Conversation

ojab
Copy link
Contributor

@ojab ojab commented Jul 15, 2021

In some cases (specifically when running inside the container with
non-default working-directory) GitHub cannot link absolute paths
produced by formatter to the code, while relative [to the project root]
paths works.

Output relative paths if they're inside current directory, so this
usecase is covered.

I can craft a public repo with reproducer, since I see this issue in private repo, but hopefully you believe me ._.
I doubt that we should care about usecases outside of GHA, so this PR could break reporting only if project is checked out into non-default directory and rubocop runs from some outer directory (i. e. not from the project root), but such cases should be trivially fixable by changing working-directory.

In the case in question it's unfixable or non-trivially fixable because GHA message<->code matching rules are non-public.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • n/a Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@ojab ojab force-pushed the fixup_github_actions_formatter branch from b464fa4 to 9a8ce73 Compare July 15, 2021 20:59
@ojab
Copy link
Contributor Author

ojab commented Jul 15, 2021

And CircleCI forces me to login and give RW access to all repos (or only private repos, if I click on non-default login option)

to see the CI failures :/
Not really nice.

@ojab ojab force-pushed the fixup_github_actions_formatter branch from 9a8ce73 to 0be1fec Compare July 15, 2021 21:06
@ojab
Copy link
Contributor Author

ojab commented Jul 15, 2021

GHA failures seems unrelated, hopefully CircleCI are the same, sending to review.

@ojab ojab marked this pull request as ready for review July 15, 2021 21:18
@ojab ojab force-pushed the fixup_github_actions_formatter branch 3 times, most recently from a167d92 to 5ea2e17 Compare July 16, 2021 00:12
In some cases (specifically when running inside the container with
non-default `working-directory`) GitHub cannot link absolute paths
produced by formatter to the code, while relative paths works.

Output relative paths if they're inside current directory, so this
usecase is covered.
@ojab ojab force-pushed the fixup_github_actions_formatter branch from 5ea2e17 to 903a4f9 Compare July 16, 2021 00:16
@ojab
Copy link
Contributor Author

ojab commented Jul 16, 2021

Ok, CI is green, but I swear that failures looked unrelated.

@ojab ojab requested a review from koic July 16, 2021 00:39
@koic koic merged commit 117511e into rubocop:master Jul 16, 2021
@koic
Copy link
Member

koic commented Jul 16, 2021

Thanks!

@ojab ojab deleted the fixup_github_actions_formatter branch July 16, 2021 00:47
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.

None yet

2 participants