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

Enable and upgrade stylelint in pre-commit #1388

Merged
merged 38 commits into from
Aug 31, 2023
Merged

Conversation

Darwinkel
Copy link
Contributor

Changes

It was planned to integrate stylelint as part of the Manon upgrade. The pipeline was implemented, but actually fixing the styling issues has not been done yet. This PR upgrades and enables it.

I'd like to request the frontend-gods @TwistMeister or @HeleenSG to perform the actual fixes :)

Running pre-commit run --all-files should already do most of the work.

Issue link

Originally mentioned in #548 and #719.

Proof

See CI.


Code Checklist

  • All the commits in this PR are properly PGP-signed and verified;
  • This PR only contains functionality relevant to the issue; tickets have been created for newly discovered issues.
  • I have written unit tests for the changes or fixes I made.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have performed a self-review of my code and refactored it to the best of my abilities.

Communication

  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have made corresponding changes to the documentation, if necessary.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@Darwinkel Darwinkel requested a review from a team as a code owner July 13, 2023 07:49
@Darwinkel Darwinkel added frontend rocky Issues related to Rocky tech-debt labels Jul 13, 2023
ammar92
ammar92 previously approved these changes Jul 13, 2023
Copy link
Contributor

@praseodym praseodym left a comment

Choose a reason for hiding this comment

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

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.

What works:

General functionality excluding styling.

What doesn't work:

Header is broken:
Screenshot 2023-07-19 at 09-30-20 OpenKAT - landing_page
Screenshot 2023-07-19 at 09-31-41 OpenKAT - step_setup_scan_ooi_detail
Crisis room layout is weird:
Screenshot 2023-07-19 at 09-34-56 OpenKAT - crisis_room
And other styling issues.

Bug or feature?:

  • bullet point + screenshot (if useful) if it is unclear whether something is a bug or an intended feature.

@TwistMeister
Copy link
Contributor

TwistMeister commented Jul 19, 2023

@praseodym can you verify if this persists when you run yarn install and yarn build and after that "clear cache and hard reload" the page, with your dev tools open so that we're sure all the correct styles are loaded?

Edit: When I do this, I see the correct styling for the header. The duplicate submit buttons isn't correct but also isn't regression, since it's been that way for a while now, so I would like to address that in another ticket.

@Darwinkel
Copy link
Contributor Author

@praseodym can you verify if this persists when you run yarn install and yarn build and after that "clear cache and hard reload" the page, with your dev tools open so that we're sure all the correct styles are loaded?

Edit: When I do this, I see the correct styling for the header. The duplicate submit buttons isn't correct but also isn't regression, since it's been that way for a while now, so I would like to address that in another ticket.

@praseodym and I just verified that the discrepancy is caused by old dist/node_modules files. Removing those folders and running make reset reproduces the below finding:

image

Copy link
Contributor

@praseodym praseodym left a comment

Choose a reason for hiding this comment

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

Just checked out a clean copy of this branch, the header is still broken.

@praseodym
Copy link
Contributor

@HeleenSG JavaScript is indeed still broken, I see the error
[Error] Failed to load resource: the server responded with a status of 404 () (manon.js, line 0) in my browser log and the login page looks like this:
Screenshot 2023-08-07 at 11 22 26

@TwistMeister TwistMeister removed their assignment Aug 8, 2023
@underdarknl underdarknl added this to the OpenKAT v1.12 milestone Aug 21, 2023
@ammar92
Copy link
Contributor

ammar92 commented Aug 29, 2023

I have just checked out this branch and can't reproduce any of the errors mentioned here before. I've cleared the Parcel cache and can compile and load manon.js from Rocky. Help text and the main menu works as well.

@praseodym
Copy link
Contributor

You probably have some old assets still left over in your Django static directory.

After building 4c481e2 in a completely clean environment, /static/dist/manon.js can't be found and the login page looks like this:
Screenshot 2023-08-29 at 14 35 58

Signed-off-by: ammar <[email protected]>
@ammar92
Copy link
Contributor

ammar92 commented Aug 30, 2023

You probably have some old assets still left over in your Django static directory.

After building 4c481e2 in a completely clean environment, /static/dist/manon.js can't be found and the login page looks like this: Screenshot 2023-08-29 at 14 35 58

You're right, I managed to reproduce this with a freshly checked-out repository. After some debugging and discussion with @HeleenSG we came to the conclusion that manon.js wasn't properly linked in rocky/templates/head.html after some restructuring of the assets directory. It should be fixed now.

@sigio sigio requested a review from praseodym August 31, 2023 09:31
@underdarknl underdarknl merged commit 2656aa1 into main Aug 31, 2023
49 checks passed
@underdarknl underdarknl deleted the feature/stylelint-fixes branch August 31, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend rocky Issues related to Rocky tech-debt
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants