Skip to content

feat!: Bootstrap project and implement env-var provider #1

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

Merged
merged 11 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

# Binary files should be left untouched
*.jar binary

3 changes: 3 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code of Conduct

Please refer to the [OpenFeature community page](https://openfeature.dev/community/#code-of-conduct) for more information on Code of Conduct.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'

jobs:
Tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run checks
run: ./gradlew check --no-daemon --stacktrace
42 changes: 42 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Lint PR'

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.

Details:

```
${{ steps.lint_pr_title.outputs.error_message }}
```

# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
33 changes: 10 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
# Compiled class file
*.class
# Ignore Gradle project-specific cache directory
.gradle

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Kotlin Gradle plugin data, see https://kotlinlang.org/docs/whatsnew20.html#new-directory-for-kotlin-data-in-gradle-projects
.kotlin/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# Ignore Gradle build output directory
build

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
# Ignore IntelliJ files
.idea

# Kotlin Gradle plugin data, see https://kotlinlang.org/docs/whatsnew20.html#new-directory-for-kotlin-data-in-gradle-projects
.kotlin/
# Ignore Kotlin files
.kotlin
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributing

TODO
13 changes: 13 additions & 0 deletions OWNERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Owners

- See [CONTRIBUTING.md](CONTRIBUTING.md) for general contribution guidelines.

## Core Developers

- Fabrizio Demaria (fabriziodemaria, Spotify)
- Nicklas Lundin (nicklasl, Spotify)
- Nicky Bondarenko (nickybondarenko, Spotify)
- Todd Baert (toddbaert, Dynatrace)
- Vahid Torkaman (vahidlazio, Spotify)

See https://github.com/open-feature/community/blob/main/config/open-feature/sdk-kotlin/workgroup.yaml.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
# kotlin-sdk-contrib
# OpenFeature Kotlin Contributions

> [!WARNING]
> This repository is not fully initialized for the moment, proceed at your own risk.

This repository is intended for OpenFeature contributions which are not included in the [OpenFeature Kotlin SDK](https://github.com/open-feature/kotlin-sdk).

The project includes:

- [Providers](./providers)
- [Hooks](./hooks)

### Software Bill of Materials (SBOM)

We publish SBOMs with all of our releases. You can find them in Maven Central alongside the artifacts.

## Contributing

see: [CONTRIBUTING.md](./CONTRIBUTING.md)

## License

Apache 2.0 - See [LICENSE](./LICENSE) for more information.

23 changes: 23 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
plugins {
alias(libs.plugins.nexus.publish)
}

allprojects {
extra["groupId"] = "dev.openfeature.kotlin.contrib"
ext["version"] = "0.1.0"
}
group = project.extra["groupId"].toString()
version = project.extra["version"].toString()

nexusPublishing {
this.repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"),
)
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
org.gradle.configuration-cache=true

# This seems to be necessary for Coroutines to work on JS. Otherwise getting the following error:
# > Task :providers:env-var:compileTestDevelopmentExecutableKotlinJs FAILED
# e: java.lang.IllegalStateException: IC internal error: can not find library org.jetbrains.kotlin:kotlinx-atomicfu-runtime
kotlinx.atomicfu.enableJsIrTransformation=true
17 changes: 17 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[versions]
kotlin = "2.1.21"
kotlinx-coroutines = "1.10.2"
open-feature-kotlin-sdk = "0.4.1"

[libraries]
openfeature-kotlin-sdk = { group="dev.openfeature", name="kotlin-sdk", version.ref="open-feature-kotlin-sdk" }
kotlin-test = { group="org.jetbrains.kotlin", name="kotlin-test", version.ref="kotlin" }
kotlinx-coroutines-core = { group="org.jetbrains.kotlinx", name="kotlinx-coroutines-core", version.ref="kotlinx-coroutines" }
kotlinx-coroutines-test = { group="org.jetbrains.kotlinx", name="kotlinx-coroutines-test", version.ref="kotlinx-coroutines" }

[plugins]
kotlin-multiplatform = { id="org.jetbrains.kotlin.multiplatform", version.ref="kotlin" }
kotlinx-atomicfu = { id="org.jetbrains.kotlinx.atomicfu", version="0.27.0" }
ktlint = { id="org.jlleitschuh.gradle.ktlint", version="12.3.0" }
nexus-publish = { id="io.github.gradle-nexus.publish-plugin", version="2.0.0" }
binary-compatibility-validator = { id="org.jetbrains.kotlinx.binary-compatibility-validator", version="0.17.0" }
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading