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

feat: add support for parsing, inspecting and autocompleting in an aggregation and a match stage written using Spring Data MongoDB INTELLIJ-172 #116

Merged
merged 8 commits into from
Jan 14, 2025

Conversation

himanshusinghs
Copy link
Contributor

@himanshusinghs himanshusinghs commented Jan 14, 2025

Description

Adds support for parsing, inspecting and autocompleting in an aggregation written using Spring Data MongoDB. The PR mainly focuses on parsing the common syntax for writing an aggregation, using MongoTemplate.aggregate and MongoTemplate.aggregateStream and a match stage written with Aggregation.match.

Checklist

Open Questions

@github-actions github-actions bot added the feat label Jan 14, 2025
Copy link

github-actions bot commented Jan 14, 2025

Coverage Report

Overall Project 78.57% -0.06%
Files changed 93.27%

File Coverage
QueryTargetCollectionExtractor.kt 92.31%
SpringCriteriaDialectParser.kt 88.65% -0.98%

Copy link

🤖 Benchmark Comparison for feat: adds support for parsing Aggregate.match

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,618,776,631.37 ops/s 2,622,327,676.93 ops/s 0.14%

- covers field check inspections and namespace check inspection
@github-actions github-actions bot added feat and removed feat labels Jan 14, 2025
@github-actions github-actions bot removed the feat label Jan 14, 2025
@himanshusinghs himanshusinghs marked this pull request as ready for review January 14, 2025 09:05
@github-actions github-actions bot added feat and removed feat labels Jan 14, 2025
@github-actions github-actions bot added feat and removed feat labels Jan 14, 2025
Copy link

🤖 Benchmark Comparison for chore: added inspection tests for Spring aggregate

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,618,776,631.37 ops/s 2,601,714,284.38 ops/s -0.65%

Copy link

🤖 Benchmark Comparison for Merge remote-tracking branch 'origin/main' into feat/INTELLIJ-172-spring-match

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,618,776,631.37 ops/s 2,658,660,840.56 ops/s 1.52%

Copy link

🤖 Benchmark Comparison for chore: minor change in CHANGELOG

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,618,776,631.37 ops/s 2,669,802,691.64 ops/s 1.95%

}
}

@Disabled("We do not yet support criteria referenced as a variable")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are such cases which I found that we did not support yet but we do support similar in JavaDriverDialectParser. If it makes sense then I will drop a ticket for these?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think it makes sense to create a ticket for this. I'm not sure we will need to tackle this soon, but let's wait to our testers to decide :D.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created INTELLIJ-184 for addressing the missing cases.

- covers both aggregate and aggregate stream calls
- additionally extended the isCollectionReference logic to also account
  for collection reference inside aggregate and aggregateStream calls
@github-actions github-actions bot added feat and removed feat labels Jan 14, 2025
@github-actions github-actions bot added feat and removed feat labels Jan 14, 2025
@github-actions github-actions bot added feat and removed feat labels Jan 14, 2025
@himanshusinghs himanshusinghs changed the title feat: adds support for parsing and linting Aggregate.match in Spring INTELLIJ-172 feat: add support for parsing, inspecting and autocompleting in an aggregation and a match stage written using Spring Data MongoDB INTELLIJ-172 Jan 14, 2025
Copy link

🤖 Benchmark Comparison for chore: added tests for autocomplete in aggregate

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,618,776,631.37 ops/s 2,667,414,071.85 ops/s 1.86%

Copy link

🤖 Benchmark Comparison for chore: add support for parsing aggregateStream

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,618,776,631.37 ops/s 2,664,571,959.62 ops/s 1.75%

Copy link

🤖 Benchmark Comparison for chore: modified changelog entry

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,618,776,631.37 ops/s 2,661,798,894.25 ops/s 1.64%

}
}

@Disabled("We do not yet support criteria referenced as a variable")
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think it makes sense to create a ticket for this. I'm not sure we will need to tackle this soon, but let's wait to our testers to decide :D.

@himanshusinghs himanshusinghs merged commit 5afd7c9 into main Jan 14, 2025
12 checks passed
@himanshusinghs himanshusinghs deleted the feat/INTELLIJ-172-spring-match branch January 14, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants