Skip to content

Commit

Permalink
Rename in last docs and replace version for 2024.1.0 (#194)
Browse files Browse the repository at this point in the history
Part of #184
  • Loading branch information
gabrielfeo authored Apr 5, 2024
1 parent 12fdb1f commit 61e2822
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Develocity API Kotlin

[![Maven Central](https://img.shields.io/badge/Maven%20Central-2023.4.0-blue)][14]
[![Javadoc](https://img.shields.io/badge/Javadoc-2023.4.0-orange)][7]
[![Maven Central](https://img.shields.io/badge/Maven%20Central-2024.1.0-blue)][14]
[![Javadoc](https://img.shields.io/badge/Javadoc-2024.1.0-orange)][7]

(formerly `gradle-enterprise-api-kotlin`)

A Kotlin library to access the [Develocity API][1], easy to use from:

Expand All @@ -16,7 +18,7 @@ api.buildsApi.getBuildsFlow(fromInstant = 0, query = "buildStartTime<-1d").forEa
}
```

The library takes care of caching under the hood (opt-in) and provides some convenience extensions.
The library takes care of caching under the hood (opt-in) and provides some convenience extensions.

## Setup

Expand All @@ -29,15 +31,12 @@ Set up environment variables and use the library from any notebook, script or pr

### Setup snippets

ℹ️ The library is now published to Maven Central under `com.gabrielfeo`. Maven Central is
recommended over JitPack.

<details>
<summary>Add to a Jupyter notebook</summary>

```
%useLatestDescriptors
%use develocity-api-kotlin(version=2023.4.0)
%use develocity-api-kotlin(version=2024.1.0)
```

</details>
Expand All @@ -46,7 +45,7 @@ recommended over JitPack.
<summary>Add to a Kotlin script</summary>

```kotlin
@file:DependsOn("com.gabrielfeo:develocity-api-kotlin:2023.4.0")
@file:DependsOn("com.gabrielfeo:develocity-api-kotlin:2024.1.0")
```

</details>
Expand All @@ -56,7 +55,7 @@ recommended over JitPack.

```kotlin
dependencies {
implementation("com.gabrielfeo:develocity-api-kotlin:2023.4.0")
implementation("com.gabrielfeo:develocity-api-kotlin:2024.1.0")
}
```

Expand Down
16 changes: 9 additions & 7 deletions docs/AccessKeys.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Access key / API token

[All API requests require authentication][1]. Provide a valid access key of your Gradle Enterprise instance as the `DEVELOCITY_API_TOKEN` environment variable.
[All API requests require authentication][1]. Provide a valid access key of your Develocity instance
as the `DEVELOCITY_API_TOKEN` environment variable.

## How to get an access key

1. Sign in to Gradle Enterprise (with a user that has “Export build data” permission)
1. Sign in to Develocity (with a user that has “Export build data” permission)
2. Go to "My settings" from the user menu in the top right-hand corner of the page
3. Go to "Access keys" from the sidebar
4. Click "Generate" on the right-hand side
Expand All @@ -13,18 +14,19 @@
## Migrating from macOS keychain support

This library used to support storing the key in the macOS keychain as `gradle-enterprise-api-kotlin`.
This feature was deprecated. You may use the method of your choice (secret managers, password manager CLIs, etc.) to store and retrieve the key to an environment.
This feature was deprecated in 2023.4.0, then removed in 2024.1.0. You may use the method of your choice
(secret managers, password manager CLIs, etc.) to store and retrieve the key to an environment.

If you used the key from keychain and need a drop-in replacement:

```
# Create an alias in your shell to fetch the key from keychain
echo 'alias ge-api-token="security find-generic-password -w -a "$LOGNAME" -s gradle-enterprise-api-kotlin"' >> ~/.zshrc
echo 'alias dat="security find-generic-password -w -a "$LOGNAME" -s gradle-enterprise-api-kotlin"' >> ~/.zshrc
# Retrieve it to the environment variable before running the program
DEVELOCITY_API_TOKEN="$(ge-api-token)" ./my-script.main.kts
DEVELOCITY_API_TOKEN="$(ge-api-token)" jupyter lab
DEVELOCITY_API_TOKEN="$(ge-api-token)" idea my-project
DEVELOCITY_API_TOKEN="$(dat)" ./my-script.main.kts
DEVELOCITY_API_TOKEN="$(dat)" jupyter lab
DEVELOCITY_API_TOKEN="$(dat)" idea my-project
```

[1]: https://docs.gradle.com/enterprise/api-manual/#access_control
7 changes: 3 additions & 4 deletions examples/example-notebooks/MostFrequentBuilds.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"Add libraries to use, via line magics. `%use` is a [line magic](https://github.com/Kotlin/kotlin-jupyter#line-magics) of the Kotlin kernel that can do much more than adding the library. To illustrate, this setup can be replaced with a single line magic.\n",
"\n",
"```kotlin\n",
"@file:DependsOn(\"com.gabrielfeo:develocity-api-kotlin:2023.4.0\")\n",
"@file:DependsOn(\"com.gabrielfeo:develocity-api-kotlin:2024.1.0\")\n",
"\n",
"import com.gabrielfeo.develocity.api.*\n",
"import com.gabrielfeo.develocity.api.model.*\n",
Expand All @@ -45,8 +45,7 @@
"is the same as:\n",
"\n",
"```\n",
"%use develocity-api-kotlin(version=2023.4.0)\n",
"\n",
"%use develocity-api-kotlin(version=2024.1.0)\n",
"```"
]
},
Expand All @@ -63,7 +62,7 @@
"outputs": [],
"source": [
"%useLatestDescriptors\n",
"%use develocity-api-kotlin(version=2023.4.0)\n",
"%use develocity-api-kotlin(version=2024.1.0)\n",
"%use coroutines(v=1.7.1)\n",
"\n",
"val api = DevelocityApi.newInstance()"
Expand Down
2 changes: 1 addition & 1 deletion examples/example-project/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ java {
}

dependencies {
implementation("com.gabrielfeo:develocity-api-kotlin:2023.4.0")
implementation("com.gabrielfeo:develocity-api-kotlin:2024.1.0")
}
2 changes: 1 addition & 1 deletion examples/example-scripts/example-script.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Run this with at least 1GB of heap to accomodate the fetched data: JAVA_OPTS=-Xmx1g
*/

@file:DependsOn("com.gabrielfeo:develocity-api-kotlin:2023.4.0")
@file:DependsOn("com.gabrielfeo:develocity-api-kotlin:2024.1.0")

import com.gabrielfeo.develocity.api.*
import com.gabrielfeo.develocity.api.model.*
Expand Down

0 comments on commit 61e2822

Please sign in to comment.