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

Add KOTLIN_SCRIPTS feature flag #583

Merged
merged 5 commits into from
Oct 2, 2022
Merged

Add KOTLIN_SCRIPTS feature flag #583

merged 5 commits into from
Oct 2, 2022

Conversation

jmfayard
Copy link
Member

@jmfayard jmfayard commented Sep 5, 2022

Minimum viable PR for #582

Discussion should happen in the issue

Copy link
Member

@LouisCAD LouisCAD left a comment

Choose a reason for hiding this comment

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

A few inline comments.

Also, a general thought I had for a while: We probably want to not depend on being a Gradle plugin for Kotlin Scripts support.
That means potentially a lot of refactoring to make a Gradle independent core.
We can sure start with a version that depends on the Gradle plugin and a host Gradle project to run, but that's not something we want in the future I think.

If you want to iterate on that Kotlin scripts support soon, I suggest that we do a little brainstorming session on the phone, or IRL when I'll be in Paris on the 3rd of November, and I write an issue or a design doc about the considerations for a first version of the feature. That should help us avoid a long to review and fix PR like what happened for versions catalog support.

Comment on lines +22 to +38
@Input
@Optional
@Option(option = "enable", description = "Enable a feature flag")
var enableFlag: FeatureFlag? = null
set(value) {
field = value
if (value != null) FeatureFlag.userSettings.put(value, true)
}

@Input
@Optional
@Option(option = "disable", description = "Disable a feature flag")
var disableFlag: FeatureFlag? = null
set(value) {
field = value
if (value != null) FeatureFlag.userSettings.put(value, false)
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be in a separate PR, don't you?

Copy link
Member Author

@jmfayard jmfayard Sep 24, 2022

Choose a reason for hiding this comment

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

actually no, because it's a copy/paste from RefreshVersionsTask that is known to work, and because adding the flag is my main focus here, see comment below

@jmfayard
Copy link
Member Author

jmfayard commented Sep 24, 2022

@LouisCAD I commented on your idea to have something independant from Gradle here #586

I still think there is no issue with adding Kotlin Script support in the current codebase.
Because there is no issue with refactoring later the "Add KTS support" part of the codebase with the rest of the codebase.

Something I need to clarify is that I do not want to implement Kotlin Scripts support in one large pull request here like I did for Gradle Versions Catalogs.

I learned my lesson that small is beautiful, and having multiple small pulll requests is less work and less stress for everyone that one huge pull request that does everything.
So this particular PR has the narrow goal of adding the feature flag and having a high level discussion on how the feature should look like but nothing more.
That's why incidently there is no real point of adding feature flags support in RefreshVersionsCleanupTask.kt in a separate PR. Adding the feature flag is my main focus here.

@LouisCAD
Copy link
Member

LouisCAD commented Oct 2, 2022

I don't think that getting this PR merged or not is an actual blocker to start working/iterating on the kotlin scripts support feature, but since we might want to add further feature flags at some point, which would generate little git conflicts, I guess it's a good idea to merge it now.

@LouisCAD LouisCAD merged commit 462ba24 into main Oct 2, 2022
@LouisCAD LouisCAD deleted the GH-582-kotlin-scripts branch October 2, 2022 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants