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

Make templates adjust with scala version #25293

Merged
merged 1 commit into from
May 3, 2022

Conversation

ia3andy
Copy link
Contributor

@ia3andy ia3andy commented May 2, 2022

The template is now different depending on the given scala version.

I added the possibility to use startsWith, endsWith and contains on String in codestarts templates thanks to @mkouba :)

@quarkus-bot quarkus-bot bot added area/codestarts area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/platform Issues related to definition and interaction with Quarkus Platform labels May 2, 2022
@ia3andy ia3andy requested review from maxandersen and gsmet May 2, 2022 07:48
@ia3andy ia3andy force-pushed the fix-scala-upgrade branch from 1e160d4 to 2eb7a7f Compare May 2, 2022 07:52
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Thanks! Added a comment.

@ia3andy ia3andy requested a review from gsmet May 2, 2022 07:53
@ia3andy ia3andy force-pushed the fix-scala-upgrade branch from 2eb7a7f to 6de8b21 Compare May 2, 2022 07:55
@gsmet gsmet added the triage/waiting-for-ci Ready to merge when CI successfully finishes label May 2, 2022
@maxandersen
Copy link
Member

Are those methods added so it does not break past versions of cli running this as they won't have access to those do they?

}

@Override
public CompletionStage<Object> resolve(EvalContext context) {
Copy link
Member

Choose a reason for hiding this comment

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

Can't we call methods on string anyway ?

@@ -52,7 +52,12 @@
<arg>-deprecation</arg>
<arg>-feature</arg>
<arg>-explaintypes</arg>
{#if scala.version.startsWith("2.12.")}
Copy link
Member

Choose a reason for hiding this comment

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

Is that really the exact version to use ? What if we upgrade to 2.13 ?

Copy link
Member

Choose a reason for hiding this comment

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

We upgraded to 2.13, that's the issue. Old versions need a different path.

Copy link
Member

Choose a reason for hiding this comment

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

Yes I get that but can't we make the template more open ended so it works with 2.13 and higher so we avoid having to keep updating ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@maxandersen we could make it configurable I guess and check if the variable exists, maybe that's the best backward/forward compatible fix.

@gsmet
Copy link
Member

gsmet commented May 2, 2022

Are those methods added so it does not break past versions of cli running this as they won't have access to those do they?

Yeah looks like this will be a problem indeed.

@quarkus-bot

This comment has been minimized.

@gsmet gsmet removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label May 2, 2022
@ia3andy
Copy link
Contributor Author

ia3andy commented May 2, 2022

Are those methods added so it does not break past versions of cli running this as they won't have access to those do they?

Yeah looks like this will be a problem indeed.

Yes :-/ Not sure how we can deal with this.. beside hard coding the version check..

@ia3andy
Copy link
Contributor Author

ia3andy commented May 2, 2022

I believe maintaining CLI forward compatibility is a burden that we could avoid!

@ia3andy
Copy link
Contributor Author

ia3andy commented May 2, 2022

We should provide an easy CLI upgrade method and lock versions compatibility, or at least have a mechanism to be able to break and ask the user to upgrade on new features.

We lock CLI compat forward on the same minor and backward for all. When a new minor/major is out, we tell the user that a new version is out and to upgrade the CLI.

@ia3andy
Copy link
Contributor Author

ia3andy commented May 3, 2022

Sorry I was tired yesterday, this fix is ok as the "base codestarts" (which are more coupled than the other extensions codestarts) are tied to the generator exactly for this reason (The previous CLI will use the previous base codestarts templates)

I will fix the tests.

@maxandersen
Copy link
Member

I believe maintaining CLI forward compatibility is a burden that we could avoid!

I 100% disagree. It's what we should enable as much as possible since it's very doable but we should not be absolutist about it.

So we and must try and minimize impact. if we force upgrade cli you make it harder to explore as users will start preferring not to try upgrading as breaks their current workflows.

@maxandersen
Copy link
Member

Sorry I was tired yesterday, this fix is ok as the "base codestarts" (which are more coupled than the other extensions codestarts) are tied to the generator exactly for this reason (The previous CLI will use the previous base codestarts templates)

Okey that's good.

But we should still do what we can to enable non core extensions to be able to work or at least guard when used with different version of cli.

@ia3andy ia3andy closed this May 3, 2022
@quarkus-bot quarkus-bot bot added triage/invalid This doesn't seem right and removed triage/backport? labels May 3, 2022
@ia3andy
Copy link
Contributor Author

ia3andy commented May 3, 2022

ah snap wrong button

@ia3andy ia3andy reopened this May 3, 2022
@quarkus-bot quarkus-bot bot removed the triage/invalid This doesn't seem right label May 3, 2022
@ia3andy ia3andy merged commit 6c4b40d into quarkusio:main May 3, 2022
@ia3andy ia3andy deleted the fix-scala-upgrade branch May 3, 2022 08:35
@quarkus-bot quarkus-bot bot added this to the 2.10 - main milestone May 3, 2022
@gsmet gsmet modified the milestones: 2.10 - main, 2.9.0.Final May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codestarts area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/platform Issues related to definition and interaction with Quarkus Platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants