-
Notifications
You must be signed in to change notification settings - Fork 10
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
Strip back pipeline to Rubocop linting only #562
Conversation
deleted files are excluded
This comment was marked as off-topic.
This comment was marked as off-topic.
1b0d198
to
3843c1e
Compare
1e103f8
to
24f4cb5
Compare
0fea6b6
to
eed711b
Compare
0ba218c
to
7515717
Compare
d294cba
to
162416a
Compare
a48cc04
to
32965eb
Compare
d05cd03
to
19f55e9
Compare
ce2bbee
to
14caba2
Compare
a248785
to
d255fc4
Compare
d255fc4
to
b44c28d
Compare
fe34579
to
4f52f5a
Compare
Note that there will probably be situations where -- in a PR -- we find out a RuboCop cop is actually not what we want. In that case, we could still use the admin privileges and merge without the check passing. Or better: file another PR that disables that Cop, merge it into dev and then merge dev into the feature branch. |
Note my changes in commit 0bb85a5. See this for the severity levels. Whenever we use a severity level smaller than See this run as an example for the described behavior (check passing but warning still showing). Note that "warning" is just a GitHub term here as GitHub just has these two levels (error/warning). Do not confuse with the rubocop warning severity level. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I am amfraid that I am not really competent in this area. Maybe @christian-heusel or @henrixapp can offer some more substantial feedback.
Hi, I don't think that this is the right approach. Mainly following the arguments in my comments on #441 (comment) . Yes, the pipeline is failing, but only partially. Recent runs like this show that there are two types of errors:
Yes, you can go ahead and remove the pipelines, but there are better ways of solving this issue. Deleting the pipeline just removes the checkbox/reminder to fix the setup, not the problem behind the situation. I think it is worth to invest some time in fixing the errors in cypress, by generalizing the tests and make them more user centered, less picking html-ids. Furthermore, I will happily assist you in finding better ways of checking eslint errors. TLDR: Changing the rubocop is fine! Replacing eslint is probably long over due. Deleting the cypress pipeline would only mitigate the symptoms. |
Hey @henrixapp, thanks a lot for your comment and your offer to help, appreciate it!
Of course, that's true. However, pragmatically speaking, we cannot fix everything at the same time and need to resolve this step by step and I want to do each step as best as possible. This means it takes time while we still have to focus on other MaMpf-related things that might have higher priority, e.g. shipping the new annotation tool #533, getting next releases ready, fixing bugs etc. The reality right now is that - as far as I know - no one looks at any check at all, even if they are failing. We just merge without worrying. The goal is to really take the checks seriously. Whenever any check fails, we should be alarmed and see where the check failed. But this is not the reality right now.
Sure and that's even advantageous in this case. After merging this PR, we will only have Rubocop linting checks for some time and can start to gain trust in the pipeline again (ok that might sound cheesy but I think that's a real thing, likewise for ad banners that one learns to fully ignore in the web, or install an adblocker but I get off track...). While only dealing with the symptoms, it doesn't mean we well toss away the underlying issues in our mind. For the linting stuff, see this roadmap. For the CI/CD stuff I should also create such an issue and will do it soon.
Due to the mentioned reasons, I'd like to outsource the discussion about specific bugs not related to Rubocop to future PRs that deal with the respective setup or to the issue section. I will come back to you when failing in trying to fix other parts of the pipeline ;) |
* Only lint Rubocop for now (and only modified files) deleted files are excluded * Scope action for PRs * Disable tests for now * Run command in one line * Fix RuboCop command * Further improve linting setup * Simplify linter setup * Print changed ruby files * Fix further errors and improve workflow file * Change random Rails files to see effects * Fix spaces in changed files * Include target branch lookup * Remove unnecessary ${{}} syntax * Fetch target branch * Improve commit retrieval * Redo whole workflow * Revert dummy changes in Rails files * Use checkout@v4 (instead of @V3) * Explicitly set fail level & force excluding files See command line flags here: https://docs.rubocop.org/rubocop/usage/basic_usage.html#command-line-flags * Add more events to trigger workflow See the docs here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request * Add printout to display RuboCop version used
Despite efforts to fix the CI/CD, many things are still not working and right now we don't even care if there is a ❌ or ✅ in the checks. To do better, we get rid of our broken CI/CD completely, start fresh and will tackle all necessary things step by step. This allows us to only include things we really need right now.
This PR therefore also removes previous work GitHub workflow files even though we might need them later. But that's not a problem as they are still accessible from the commit history.
This PR does the first step by introducing a check that only passes if Ruby files changed in a PR are correctly linted according to the RuboCop rules specified in
.rubocop.yml
. Only the changed files are considered.Apparently, a line-based comparison is not possible with rubocop, e.g. only check the lines that were changes in a PR, not the whole files. This shouldn't be a big problem once we file a PR that fixes Ruby style violations in the entire code base. From then on, in a pull request, style violations for files or lines should practically be the same thing.
See how a sample run looks like here. It is failing and lists all style violations nicely using GitHub workflow comments (it only took 21s for the complete check for two files). Note that if one clicks on
Details
next to the checks, you then have to click onSummary
to see these comments presented in this way.But what is even better: you will see these violations directly in the
Files changed
tab:Note that if no Ruby files were changed in a PR, the job will pass with a ✅.