• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wooga / atlas-secrets / 15 / 1
78%
master: 92%

Build:
Build:
LAST BUILD BRANCH: release/1.x
DEFAULT BRANCH: master
Ran 23 Nov 2021 10:55AM UTC
Files 26
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Nov 2021 10:55AM UTC coverage: 78.035% (+0.1%) from 77.907%
15.1

push

jenkins

Improve API usage of SecretResolveChain in secrets extension (#301)

Description
===========

The initial idea of configuring resolvers for the global resolver
was to declare a static chain in the `secrets` extension and
use the `List` interface to be able to `add`,`remove` resolver.

```groovy
secrets.secretResolverChain {
    add(new wooga.gradle.secrets.internal.EnvironmentResolver())
}
```

I don't want to see imports or calls to `new` in `build.gradle` files.
The last patch also brought in the `SecretResolverFactory` which was geared
towards this specific usecase. I thought that a construct like:

```groovy
secrets.secretResolverChain {
    add(secrets.environmentResolver())
}
```

But this leads to scoping issues because the call with a closure is not
actually running like groovy would execute a clojure with `with` for example.
Means that the passed closure can't see the secrets extension or the project.
Which means that it can't reach the factory method in the extension.

Because the `SecretResolverFactory` is a simple standalone `trait` object
I'm able to implement into any class. So I did just that and added the `trait`
to the `SecretResolverChain`. This allow now to configure the chain resolver like this:

```groovy
secrets.secretResolverChain {
    add(environmentResolver())
}
```

I think that is a nice and simple solution.
After this I took another look at the `SecretResolverFactory` and
decided to add some more overloads to pass the aws region as `String`.

```groovy
secrets.secretResolverChain {
    add((awsSecretResolver("eu-west-2"))
}
```

This just helps to reduce friction for simple configurations.

Changes
=======

* ![IMPROVE] `SecretResolverChain` API with implemented `SecretResolverFactory` trait
* ![ADD] `secretText(String secretId)` method to extension
* ![IMPROVE] `Depricate` method `secretValue(String secretId). Will be removed with `1.0.0` release

135 of 173 relevant lines covered (78.03%)

0.78 hits per line

Source Files on job 15.1
  • Tree
  • List 0
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 15
  • 07a96e1a on github
  • Prev Job for on release/1.x (#13.1)
  • Next Job for on release/1.x (#17.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc