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

Feature CMR-9779 elastic lint #2115

Merged
merged 13 commits into from
May 10, 2024
Merged

Feature CMR-9779 elastic lint #2115

merged 13 commits into from
May 10, 2024

Conversation

jceaser
Copy link
Contributor

@jceaser jceaser commented May 8, 2024

Overview

Lint effort

What is the feature/fix?

Clean up the elastic code using clj-kondo

The project file is also cleaned up to use the latest libraries in the lint profile. Then code changes were made to support clj-kondo, bikeshed, and kibit.

What is the Solution?

There are several commits, each for different cleanup tools like Kondo, bikeshed, and kibit so that reviewers can see which changes were made for each of the tools.

Also, all are2 calls have been converted to are3 in spatial lib. Spacial lib should also not issue Warnings about the abs function.

What areas of the application does this impact?

The elastic utils project and the spatial library have been cleaned up. Only elastic utils has been passed through bikeshed and kibit.

Checklist

  • I have updated/added unit and integration tests that prove my fix is effective or that my feature works
  • New and existing unit and int tests pass locally and remotely with my changes
  • I have removed unnecessary/dead code and imports in files I have changed
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have cleaned up integration tests by doing one or more of the following:
    • de-duped, consolidated, removed dead int tests
    • transformed applicable int tests into unit tests
    • refactored to reduce number of system state resets by updating fixtures (use-fixtures :each (ingest/reset-fixture {})) to be :once instead of :each

Test cleanup, there are now no are2 in spatial lib.

@jceaser jceaser requested review from jmaeng72 and eereiter May 8, 2024 12:53
@jceaser jceaser added the code-quality Effort to improve the quality of the code label May 8, 2024
@jceaser jceaser marked this pull request as ready for review May 8, 2024 18:08
@codecov-commenter
Copy link

codecov-commenter commented May 8, 2024

Codecov Report

Attention: Patch coverage is 12.40310% with 113 lines in your changes are missing coverage. Please review.

Project coverage is 57.77%. Comparing base (d3a9ce3) to head (214b56b).

Files Patch % Lines
...tils-lib/src/cmr/elastic_utils/search/es_index.clj 8.33% 22 Missing ⚠️
...c/cmr/elastic_utils/search/es_query_to_elastic.clj 0.00% 22 Missing ⚠️
.../cmr/elastic_utils/search/access_control_index.clj 0.00% 11 Missing ⚠️
...c/cmr/elastic_utils/search/keywords_to_elastic.clj 0.00% 9 Missing ⚠️
...c/cmr/elastic_utils/search/es_params_converter.clj 0.00% 8 Missing ⚠️
...c/cmr/elastic_utils/search/es_query_validation.clj 0.00% 7 Missing ⚠️
...tic-utils-lib/src/cmr/elastic_utils/index_util.clj 0.00% 5 Missing ⚠️
...c/cmr/elastic_utils/search/es_index_name_cache.clj 0.00% 5 Missing ⚠️
...tils-lib/src/cmr/elastic_utils/datetime_helper.clj 42.85% 4 Missing ⚠️
...lib/src/cmr/elastic_utils/search/es_acl_parser.clj 0.00% 4 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2115      +/-   ##
==========================================
- Coverage   57.81%   57.77%   -0.04%     
==========================================
  Files        1044     1044              
  Lines       70311    70350      +39     
  Branches     1967     1965       -2     
==========================================
- Hits        40649    40646       -3     
- Misses      27807    27845      +38     
- Partials     1855     1859       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…unction in query to elastic to one of the other options out of 3
@jmaeng72
Copy link
Contributor

jmaeng72 commented May 9, 2024

Approved with one last feedback on a lingering unused comment

…it and peer review. Test pass with this version.
@jceaser jceaser merged commit 1eac0eb into master May 10, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality Effort to improve the quality of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants