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

DT-921: Add Spotless to build process. #999

Closed
wants to merge 4 commits into from
Closed

Conversation

rushtong
Copy link
Contributor

@rushtong rushtong commented Jan 22, 2025

Addresses

Addresses https://broadworkbench.atlassian.net/browse/DT-921 only for Consent-Ontology

Summary

Adds spotless to the build process. PRs will potentially fail the maven action if there are any formatting problems.

This PR is limited to these things:

  1. Adding the spotless plugin
  2. Update the checkout for specific actions so they fetch origin/develop. Necessary to apply the ratchetFrom configuration option for spotless.
  3. Applying the results of mvn spotless:apply
  4. Ignore semgrep warning from updating StorageFactory

There are some outstanding cleanup problems that we can address in a future PR/ticket, for example, there are some unused classes touched in this PR like UseRestrictionKeys and ValidationResponse.


Have you read CONTRIBUTING.md lately? If not, do that first.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

@rushtong rushtong marked this pull request as ready for review January 22, 2025 14:26
@rushtong rushtong requested a review from a team as a code owner January 22, 2025 14:26
@rushtong rushtong requested review from pshapiro4broad and rjohanek and removed request for a team January 22, 2025 14:26
@@ -24,6 +24,7 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

Choose a reason for hiding this comment

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

what does this do?

Copy link
Contributor

Choose a reason for hiding this comment

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

This downloads the current version of the repository instead of the entire repository history.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what I described in step 2 - it fetches the full history of the repo so that the local checkout has access to the origin/develop branch. See https://github.com/actions/checkout for docs. Without this, spotless isn't able to apply the rachetFrom configuration.

Copy link

@rjohanek rjohanek left a comment

Choose a reason for hiding this comment

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

spotless changes look good, thanks!

@fboulnois
Copy link
Contributor

How does this interact with our checked-in codeStyles?

@rushtong
Copy link
Contributor Author

How does this interact with our checked-in codeStyles?

It applies the googleJavaFormat style which is what we currently use.

@rushtong
Copy link
Contributor Author

Going to close this for the time being. We need to better clarify where this should sit in the local build/dev/deploy cycle and how to deal with potential conflicts with .idea/codeStyles

@rushtong rushtong closed this Jan 22, 2025
@rushtong rushtong deleted the gr-DT-921-spotless branch January 22, 2025 15:42
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.

3 participants