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

Load Razor source generators from SDK #9210

Merged
merged 20 commits into from May 8, 2024

Conversation

CristianAmbrosini
Copy link
Contributor

@CristianAmbrosini CristianAmbrosini commented Apr 26, 2024

Fixes #9212

@github-actions github-actions bot added this to In progress in Best Kanban Apr 26, 2024
@CristianAmbrosini CristianAmbrosini changed the base branch from master to sma/ut-razor-cleaning April 26, 2024 10:10
@CristianAmbrosini CristianAmbrosini marked this pull request as draft April 26, 2024 10:10
@CristianAmbrosini CristianAmbrosini changed the title Look for Razor sourcegenerators .dlls locally Load Razor source generators from SDK Apr 26, 2024
@CristianAmbrosini CristianAmbrosini linked an issue Apr 26, 2024 that may be closed by this pull request
Base automatically changed from sma/ut-razor-cleaning to master April 26, 2024 13:03
@CristianAmbrosini CristianAmbrosini force-pushed the cristian/local-sourcegenerators branch from 33da13f to 77c6172 Compare May 2, 2024 11:11
Copy link
Contributor

@Tim-Pohlmann Tim-Pohlmann left a comment

Choose a reason for hiding this comment

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

The implementation is sound! The UTs need some work.

Copy link
Contributor

@Tim-Pohlmann Tim-Pohlmann left a comment

Choose a reason for hiding this comment

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

Round 2

Copy link
Contributor

@Tim-Pohlmann Tim-Pohlmann left a comment

Choose a reason for hiding this comment

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

LGTM. Left a few minor improvement suggestions.

@CristianAmbrosini CristianAmbrosini marked this pull request as ready for review May 6, 2024 15:17
Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a comment

Choose a reason for hiding this comment

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

The implementation doesn't seem to do what we said.
And the condition causing the coverage problem can be safely removed

Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a comment

Choose a reason for hiding this comment

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

The implementation is still wrong. It doens't use the latest.

It should use the same as the object assembly, and that will fall to the latest without depending on string-comparison mismatch.

Imagine
8.0.0
8.0.1
8.9.0
8.10.0

While 8.10.0 is the latest that we currently run on, the First will pick up 8.0.0 instead.
Changing it to Last doesn't work, because that would pick up 8.9.0 instead.

It needs to be reworked

Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 50 to 51
.OrderByDescending(x => Version.Parse(new DirectoryInfo(x).Name))
.First();
Copy link
Contributor

Choose a reason for hiding this comment

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

What about OrderBy(..).Last() to have more positive logic?

@CristianAmbrosini CristianAmbrosini enabled auto-merge (squash) May 8, 2024 07:29
Copy link

sonarcloud bot commented May 8, 2024

Quality Gate Passed Quality Gate passed for 'Sonar .NET Java Plugin'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 8, 2024

@CristianAmbrosini CristianAmbrosini merged commit 467dcd7 into master May 8, 2024
26 checks passed
Best Kanban automation moved this from In progress to Validate Peach May 8, 2024
@CristianAmbrosini CristianAmbrosini deleted the cristian/local-sourcegenerators branch May 8, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Best Kanban
  
Validate Peach
Development

Successfully merging this pull request may close these issues.

Load Razor source generators from SDK
3 participants