Commit Graph

4 Commits

Author SHA1 Message Date
Christopher Homberger
bd2fcb14be feat: allow inline yaml config instead of string literal (#43)
### Description of the change

Allow to insert the act_runner config as yaml into the chart values.

### Benefits

Yaml editor will report yaml errors, instead of the deployed runner.

### Possible drawbacks

No limitations, string config works like before.

### Applicable issues

N/A

### Additional information

Usage like this, just omit the block scalar token

```yaml
enabled: true
statefulset:
  actRunner:
    # See full example here: https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml
    config:
      log:
        level: debug
      cache:
        enabled: false
      container:
        valid_volumes:
        - /var/run/docker.sock
        options: -v /var/run/docker.sock:/var/run/docker.sock

## Specify an existing token secret
##
existingSecret: "runner-token2"
existingSecretKey: "token"

## Specify the root URL of the Gitea instance
giteaRootURL: "http://192.168.1.2:3000"
```

I do not like the regex test approach, but I didn't come up with a better one. I wish that I can parse the nested yaml in the helm tests.

### ⚠ BREAKING

N/A

### Checklist

- [x] Helm templating unittests are added (required when changing anything in `templates` folder)
- [x] All added template resources MUST render a namespace in metadata

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/43
Reviewed-by: DaanSelen <daanselen@noreply.gitea.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2025-09-21 18:21:34 +00:00
Christopher Homberger
41c4bf1bc7 refactor: use gitea.actions for global defines (#10)
### Description of the change

Just moves all defines under a new gitea.actions prefix.

### Additional information

Reduce possibility to cause a name clash with the helm-gitea chart if both would be included in a single helm chart installation.

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/10
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2025-04-09 19:33:45 +00:00
Christopher Homberger
5b19636034 chore(core): refactor to make all unit tests pass (#6)
_This is the first time I ever messed with helm and is an experiment to show what prevents the tests to pass and how far it still depends on the gitea chart_
### Description of the change

- Deletes a single test that seems to depend directly on gitea
- make all tests pass
- Moves all value accesses from `actions` one level up
- Copies content of the gitea chart required by the existing test
  - Reveals all dependencies that needs to be decoupled
- Fixes readme generation
  - add package.json
  - copy dependent readme section from helm-gitea
- Removes all dependencies
- giteaRootURL is now required to be provided
  - consistency check that this value has been provided
  - added test for consistency failure
- nc command no longer uses an hardcoded dns name and is checked in tests
  - added test
- Copied yamllint from helm-gitea
  - added pnpm lock file exclusion
- Installed pnpm in the workflow
- Updated make unittest command in CI to unittest-helm
### Benefits

The existing tests are passing

### Possible drawbacks

The provision job might still not work.

### Applicable issues

- Fixes #5

### Additional information

The following usage should now deploy
```yaml
existingSecret: "somesecret"
existingSecretKey: "key"

## Specify the root URL of the Gitea instance
giteaRootURL: "http://somedomain:3000"
```
### ⚠ BREAKING

- giteaRootURL is now required to be provided
- Moves all value accesses from `actions` one level up
  - The values.yml had this change without updating tests / dev Readme

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/6
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.com>
Reviewed-by: volker.raschek <markus.pesch@web.de>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2025-03-30 23:13:31 +00:00
pat-s
42fe8c02c2 chore: add templates, unittests and workflows 2025-03-06 22:25:49 +01:00