generic-gitlab-cicd 0.3.3__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/PKG-INFO +77 -95
  2. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/README.md +76 -94
  3. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/__init__.py +1 -1
  4. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_gitlab_cicd.egg-info/PKG-INFO +77 -95
  5. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/pyproject.toml +1 -1
  6. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/__main__.py +0 -0
  7. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/cli.py +0 -0
  8. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/compiler.py +0 -0
  9. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/config.py +0 -0
  10. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/dependencies.py +0 -0
  11. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/models.py +0 -0
  12. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/runtime.py +0 -0
  13. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/setup.py +0 -0
  14. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/sources.py +0 -0
  15. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/workflows/__init__.py +0 -0
  16. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/workflows/compiler.py +0 -0
  17. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/workflows/ecosystems.py +0 -0
  18. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/workflows/helm.py +0 -0
  19. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/workflows/models.py +0 -0
  20. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/workflows/publication.py +0 -0
  21. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_ci/workflows/runtime.py +0 -0
  22. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_gitlab_cicd.egg-info/SOURCES.txt +0 -0
  23. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_gitlab_cicd.egg-info/dependency_links.txt +0 -0
  24. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_gitlab_cicd.egg-info/entry_points.txt +0 -0
  25. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_gitlab_cicd.egg-info/requires.txt +0 -0
  26. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/generic_gitlab_cicd.egg-info/top_level.txt +0 -0
  27. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/setup.cfg +0 -0
  28. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/tests/test_chart.py +0 -0
  29. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/tests/test_framework.py +0 -0
  30. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/tests/test_product.py +0 -0
  31. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/tests/test_publication.py +0 -0
  32. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/tests/test_review.py +0 -0
  33. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/tests/test_setup.py +0 -0
  34. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/tests/test_sources.py +0 -0
  35. {generic_gitlab_cicd-0.3.3 → generic_gitlab_cicd-0.3.4}/tests/test_workflows.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: generic-gitlab-cicd
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Validated project configuration and reproducible GitLab delivery pipelines
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -19,129 +19,111 @@ The package is named `generic-gitlab-cicd`; the command is `generic-ci`. GitLab
19
19
 
20
20
  [Quick start](#quick-start) · [Workflow guide](docs/workflows-revision-one.md) · [CLI reference](docs/cli-reference.md) · [Examples](examples/workflows) · [Documentation](docs/README.md)
21
21
 
22
- ## Why use it?
22
+ ## One repository. Tests, packages, and deployment.
23
23
 
24
- Use this toolkit when several services or repositories share delivery conventions, but each team needs to choose its own checks and release behavior.
24
+ Keep your shared Python package and API together. Generic CI tests them, publishes the package on release, and deploys the API to OpenShift.
25
25
 
26
- - **Keep application intent readable.** Name your checks and select them for pushes, merge requests, releases, manual pipelines, or schedules. The toolkit does not insert an assumed test suite.
27
- - **Reuse platform configuration.** Share runner tags, prepared images, registries, and deployment targets through organization defaults and Git-backed templates.
28
- - **Connect monorepo work explicitly.** Declare which projects are affected by upstream changes and which jobs need upstream artifacts. Artifact receipts verify the producing commit, pipeline, configuration, and file checksums.
29
- - **Support internal infrastructure.** Use prepared runtime images, internal package services, and cached configuration sources. Consumer jobs have no automatic public toolkit bootstrap.
30
- - **Review generated changes before execution.** Commit the generated YAML alongside its inputs; validate configuration and detect generation drift locally or in CI.
31
-
32
- For a repository with a few standalone jobs, handwritten GitLab CI may be sufficient. This toolkit is most useful when repeated release, dependency, and deployment rules are becoming difficult to maintain consistently.
33
-
34
- ## How it works
35
-
36
- | File | What belongs here |
37
- | --- | --- |
38
- | `delivery.yml` | Projects, commands, workflow selection, builds, and deployments |
39
- | `ci-platform.yml` | Runtime images, runner tags, registry locations, and deployment targets |
40
- | `.gitlab-ci.yml` | Generated pipeline; regenerate after editing the inputs |
41
- | `generic-ci.yml` + `generic-ci.lock.json` | Optional organization source configuration and its pinned commit |
42
-
43
- Run `generic-ci validate`, inspect `generic-ci explain`, then run `generic-ci render`. Commit the inputs and generated pipeline together. GitLab executes a planner and the selected runtime jobs using your prepared images.
44
-
45
- ## Quick start
46
-
47
- Install the CLI as shown below, then run **`generic-ci setup`** from your application repository. It walks you through organization templates or standalone configuration, validates the result, and previews files before writing. It never overwrites existing files or installs a pre-commit hook.
26
+ ```yaml
27
+ version: 1
48
28
 
49
- ```sh
50
- generic-ci setup
29
+ projects:
30
+ sdk:
31
+ path: packages/sdk
32
+ python: {}
33
+ checks:
34
+ tests:
35
+ script: [uv run --no-sync pytest]
36
+ package:
37
+ index: internal
38
+ release:
39
+ tag: v{version}
40
+ workflows:
41
+ merge-request:
42
+ checks: [tests]
43
+ release:
44
+ checks: [tests]
45
+ publish: true
46
+
47
+ api:
48
+ path: services/api
49
+ depends-on: [sdk]
50
+ python: {}
51
+ checks:
52
+ tests:
53
+ script: [uv run --no-sync pytest]
54
+ container:
55
+ dockerfile: Dockerfile
56
+ release:
57
+ tag: v{version}
58
+ needs: [sdk]
59
+ workflows:
60
+ merge-request:
61
+ checks: [tests]
62
+ release:
63
+ checks: [tests]
64
+ build: [container]
65
+
66
+ deployments:
67
+ api:
68
+ target: production
69
+ chart:
70
+ path: deploy/chart
71
+ values: [deploy/values.yaml]
72
+ images:
73
+ - from: api.build-image
74
+ set:
75
+ repository: apps.api.image.repository
76
+ tag: apps.api.image.tag
77
+ workflows:
78
+ release:
79
+ when: manual
51
80
  ```
52
81
 
53
- Organization mode asks for a Git configuration repository (GitHub or GitLab), revision, template, and application settings. Standalone mode detects the ecosystem, asks for your existing test command and runtime infrastructure, and optionally creates a manual OpenShift MR preview with `deploy/values.yaml`. The chart must already be published and compatible with generic-app 2.x; setup does not provision infrastructure.
82
+ **What you get:**
54
83
 
55
- Both paths write the generated pipeline, setup notes, and local editor schemas. See [setup and editor integration](docs/setup-revision-one.md) for unattended flags, dry runs, schema mappings, and limitations.
84
+ - **On merge requests:** test affected projects. SDK changes also select the API for testing.
85
+ - **On a release tag:** run checks, publish the SDK, and build the API image. The API release depends on SDK publication; its tests and image build can run independently.
86
+ - **When you approve deployment:** deploy the built API image through Helm to OpenShift.
56
87
 
57
- The following manual walkthrough explains the files setup produces and remains useful when editing an existing configuration.
88
+ Both projects use a shared version: projects at `1.2.0` release under the protected tag `v1.2.0`. Dependency installation follows each project's declared dependencies and committed lockfile; `depends-on` selects work, not package replacements.
58
89
 
59
- This example adds push and merge-request tests to an **existing Python project**. It assumes the repository already has a `pyproject.toml`, a committed `uv.lock`, and pytest declared in a dependency group. Replace the test command if your project uses something else.
90
+ Your organization supplies prepared runtime images, registry settings, and the production target in `ci-platform.yml`. The application's `deploy/chart` and `deploy/values.yaml` describe the deployment. Start with the [shared chart](charts/generic-app) and [values example](examples/helm-values.yaml); configure the named `internal` publishing index and CI credentials through your platform.
60
91
 
61
- ### 1. Install the CLI
92
+ ## Quick start
62
93
 
63
- Use Python **3.11 or newer**. From a checkout of this repository, install into an isolated environment:
94
+ Use Python **3.11 or newer**. From a checkout of this toolkit, install the CLI into an isolated environment:
64
95
 
65
96
  ```sh
66
97
  python -m venv .venv
67
98
  . .venv/bin/activate
68
99
  python -m pip install .
69
- generic-ci --help
70
100
  ```
71
101
 
72
- For repeatable organization setup, distribute a versioned wheel through your approved internal package index or wheelhouse. Keep the authoring CLI and the toolkit installed in runner images on the **same version**. This source revision is **0.3.3**; source availability does not imply that version has been published to PyPI.
73
-
74
- The install command uses your configured package sources. In an air-gapped environment, prepare the wheel and all dependencies internally first.
75
-
76
- ### 2. Provide the runtime configuration
102
+ Then, from your application repository:
77
103
 
78
- In your **application repository**, create `ci-platform.yml`:
79
-
80
- ```yaml
81
- version: 1
82
- defaults:
83
- tags: [internal-linux]
84
- images:
85
- python: registry.example.internal/ci/python-toolkit:0.3.3
86
- container-builder:
87
- engine: buildah
88
- image: registry.example.internal/ci/buildah-toolkit:0.3.3
89
- registries:
90
- containers: registry.example.internal/apps
91
- previews: registry.example.internal/previews
92
- allowed-hosts:
93
- - registry.example.internal
94
- - gitlab.example.internal
95
- variables:
96
- UV_PYTHON_DOWNLOADS: never
97
- ```
98
-
99
- **Replace the example addresses and tags with your platform's values.** These images are placeholders, not publicly available toolkit images. The Python image needs Python, Git, uv, the matching toolkit, and your internal package/CA configuration. The builder image needs Buildah and the matching Python toolkit runtime. Builder and registry settings are required by the platform schema even though this test-only example does not build or push an image.
100
-
101
- If your organization already provides a platform file or configuration source, use it. Platform maintainers can start with the [image-factory setup guide](starters/image-factory/CI-SETUP.md). Installing the CLI on your laptop does not prepare runner images.
102
-
103
- ### 3. Define the checks
104
-
105
- Create `delivery.yml` in the application repository:
106
-
107
- ```yaml
108
- version: 1
109
- projects:
110
- app:
111
- path: .
112
- python:
113
- groups: all
114
- checks:
115
- unit:
116
- script:
117
- - uv run --no-sync pytest
118
- workflows:
119
- push:
120
- checks: [unit]
121
- merge-request:
122
- checks: [unit]
104
+ ```sh
105
+ generic-ci setup
123
106
  ```
124
107
 
125
- `path` is relative to the repository root. Commands run in that project directory. Python dependency preparation uses the committed lockfile; `--no-sync` prevents the test command from resynchronizing the environment. With `groups: all`, dependency groups must be mutually compatible.
108
+ Setup guides you through organization templates or standalone configuration, previews files before writing, and includes local editor schemas. Start with its single-app configuration and add projects as needed, or choose an organization template for your monorepo. See the [setup guide](docs/setup-revision-one.md) for prepared images, unattended options, and editor integration.
126
109
 
127
- This configuration selects `unit` for push and merge-request workflows. Push pipelines are suppressed when an open MR takes their place. It does not publish a package, build an image, or deploy an application.
128
-
129
- ### 4. Validate, inspect, and generate
130
-
131
- Run these commands from the application repository using the installed CLI:
110
+ After editing your configuration:
132
111
 
133
112
  ```sh
134
113
  generic-ci validate
135
- generic-ci explain -o ci-explain.json
136
114
  generic-ci render -o .gitlab-ci.yml
137
- generic-ci render --check -o .gitlab-ci.yml
138
115
  ```
139
116
 
140
- Review `ci-explain.json` and the generated jobs, then commit `delivery.yml`, `ci-platform.yml`, and `.gitlab-ci.yml`. The explanation file is optional diagnostic output.
117
+ Review and commit `delivery.yml`, your platform configuration, and the generated `.gitlab-ci.yml` together. Validate the generated pipeline with your GitLab CI Lint, then push your branch.
118
+
119
+ **Prefer autocomplete?** Setup exports the schemas automatically. You can also refresh them from the installed CLI:
141
120
 
142
- Validate the generated YAML with **your GitLab CI Lint**, push the branch, and inspect the first pipeline. Local validation checks configuration and the job graph; it does not run pytest or check that a registry image exists. Your runner must match the configured tags and be able to pull the runtime image and reach the configured internal services.
121
+ ```sh
122
+ generic-ci schema -o .generic-ci/delivery.schema.json
123
+ generic-ci schema --platform-schema -o .generic-ci/platform.schema.json
124
+ ```
143
125
 
144
- After changing a command, platform setting, or source lock, render again. Use `generic-ci render --check -o .gitlab-ci.yml` in CI to detect stale generated YAML.
126
+ Associate them with `delivery.yml` and `ci-platform.yml` in your editor. The [editor guide](docs/setup-revision-one.md#editor-completion-and-validation) includes PyCharm instructions.
145
127
 
146
128
  ## Add the delivery features you need
147
129
 
@@ -8,129 +8,111 @@ The package is named `generic-gitlab-cicd`; the command is `generic-ci`. GitLab
8
8
 
9
9
  [Quick start](#quick-start) · [Workflow guide](docs/workflows-revision-one.md) · [CLI reference](docs/cli-reference.md) · [Examples](examples/workflows) · [Documentation](docs/README.md)
10
10
 
11
- ## Why use it?
11
+ ## One repository. Tests, packages, and deployment.
12
12
 
13
- Use this toolkit when several services or repositories share delivery conventions, but each team needs to choose its own checks and release behavior.
13
+ Keep your shared Python package and API together. Generic CI tests them, publishes the package on release, and deploys the API to OpenShift.
14
14
 
15
- - **Keep application intent readable.** Name your checks and select them for pushes, merge requests, releases, manual pipelines, or schedules. The toolkit does not insert an assumed test suite.
16
- - **Reuse platform configuration.** Share runner tags, prepared images, registries, and deployment targets through organization defaults and Git-backed templates.
17
- - **Connect monorepo work explicitly.** Declare which projects are affected by upstream changes and which jobs need upstream artifacts. Artifact receipts verify the producing commit, pipeline, configuration, and file checksums.
18
- - **Support internal infrastructure.** Use prepared runtime images, internal package services, and cached configuration sources. Consumer jobs have no automatic public toolkit bootstrap.
19
- - **Review generated changes before execution.** Commit the generated YAML alongside its inputs; validate configuration and detect generation drift locally or in CI.
20
-
21
- For a repository with a few standalone jobs, handwritten GitLab CI may be sufficient. This toolkit is most useful when repeated release, dependency, and deployment rules are becoming difficult to maintain consistently.
22
-
23
- ## How it works
24
-
25
- | File | What belongs here |
26
- | --- | --- |
27
- | `delivery.yml` | Projects, commands, workflow selection, builds, and deployments |
28
- | `ci-platform.yml` | Runtime images, runner tags, registry locations, and deployment targets |
29
- | `.gitlab-ci.yml` | Generated pipeline; regenerate after editing the inputs |
30
- | `generic-ci.yml` + `generic-ci.lock.json` | Optional organization source configuration and its pinned commit |
31
-
32
- Run `generic-ci validate`, inspect `generic-ci explain`, then run `generic-ci render`. Commit the inputs and generated pipeline together. GitLab executes a planner and the selected runtime jobs using your prepared images.
33
-
34
- ## Quick start
35
-
36
- Install the CLI as shown below, then run **`generic-ci setup`** from your application repository. It walks you through organization templates or standalone configuration, validates the result, and previews files before writing. It never overwrites existing files or installs a pre-commit hook.
15
+ ```yaml
16
+ version: 1
37
17
 
38
- ```sh
39
- generic-ci setup
18
+ projects:
19
+ sdk:
20
+ path: packages/sdk
21
+ python: {}
22
+ checks:
23
+ tests:
24
+ script: [uv run --no-sync pytest]
25
+ package:
26
+ index: internal
27
+ release:
28
+ tag: v{version}
29
+ workflows:
30
+ merge-request:
31
+ checks: [tests]
32
+ release:
33
+ checks: [tests]
34
+ publish: true
35
+
36
+ api:
37
+ path: services/api
38
+ depends-on: [sdk]
39
+ python: {}
40
+ checks:
41
+ tests:
42
+ script: [uv run --no-sync pytest]
43
+ container:
44
+ dockerfile: Dockerfile
45
+ release:
46
+ tag: v{version}
47
+ needs: [sdk]
48
+ workflows:
49
+ merge-request:
50
+ checks: [tests]
51
+ release:
52
+ checks: [tests]
53
+ build: [container]
54
+
55
+ deployments:
56
+ api:
57
+ target: production
58
+ chart:
59
+ path: deploy/chart
60
+ values: [deploy/values.yaml]
61
+ images:
62
+ - from: api.build-image
63
+ set:
64
+ repository: apps.api.image.repository
65
+ tag: apps.api.image.tag
66
+ workflows:
67
+ release:
68
+ when: manual
40
69
  ```
41
70
 
42
- Organization mode asks for a Git configuration repository (GitHub or GitLab), revision, template, and application settings. Standalone mode detects the ecosystem, asks for your existing test command and runtime infrastructure, and optionally creates a manual OpenShift MR preview with `deploy/values.yaml`. The chart must already be published and compatible with generic-app 2.x; setup does not provision infrastructure.
71
+ **What you get:**
43
72
 
44
- Both paths write the generated pipeline, setup notes, and local editor schemas. See [setup and editor integration](docs/setup-revision-one.md) for unattended flags, dry runs, schema mappings, and limitations.
73
+ - **On merge requests:** test affected projects. SDK changes also select the API for testing.
74
+ - **On a release tag:** run checks, publish the SDK, and build the API image. The API release depends on SDK publication; its tests and image build can run independently.
75
+ - **When you approve deployment:** deploy the built API image through Helm to OpenShift.
45
76
 
46
- The following manual walkthrough explains the files setup produces and remains useful when editing an existing configuration.
77
+ Both projects use a shared version: projects at `1.2.0` release under the protected tag `v1.2.0`. Dependency installation follows each project's declared dependencies and committed lockfile; `depends-on` selects work, not package replacements.
47
78
 
48
- This example adds push and merge-request tests to an **existing Python project**. It assumes the repository already has a `pyproject.toml`, a committed `uv.lock`, and pytest declared in a dependency group. Replace the test command if your project uses something else.
79
+ Your organization supplies prepared runtime images, registry settings, and the production target in `ci-platform.yml`. The application's `deploy/chart` and `deploy/values.yaml` describe the deployment. Start with the [shared chart](charts/generic-app) and [values example](examples/helm-values.yaml); configure the named `internal` publishing index and CI credentials through your platform.
49
80
 
50
- ### 1. Install the CLI
81
+ ## Quick start
51
82
 
52
- Use Python **3.11 or newer**. From a checkout of this repository, install into an isolated environment:
83
+ Use Python **3.11 or newer**. From a checkout of this toolkit, install the CLI into an isolated environment:
53
84
 
54
85
  ```sh
55
86
  python -m venv .venv
56
87
  . .venv/bin/activate
57
88
  python -m pip install .
58
- generic-ci --help
59
89
  ```
60
90
 
61
- For repeatable organization setup, distribute a versioned wheel through your approved internal package index or wheelhouse. Keep the authoring CLI and the toolkit installed in runner images on the **same version**. This source revision is **0.3.3**; source availability does not imply that version has been published to PyPI.
62
-
63
- The install command uses your configured package sources. In an air-gapped environment, prepare the wheel and all dependencies internally first.
64
-
65
- ### 2. Provide the runtime configuration
91
+ Then, from your application repository:
66
92
 
67
- In your **application repository**, create `ci-platform.yml`:
68
-
69
- ```yaml
70
- version: 1
71
- defaults:
72
- tags: [internal-linux]
73
- images:
74
- python: registry.example.internal/ci/python-toolkit:0.3.3
75
- container-builder:
76
- engine: buildah
77
- image: registry.example.internal/ci/buildah-toolkit:0.3.3
78
- registries:
79
- containers: registry.example.internal/apps
80
- previews: registry.example.internal/previews
81
- allowed-hosts:
82
- - registry.example.internal
83
- - gitlab.example.internal
84
- variables:
85
- UV_PYTHON_DOWNLOADS: never
86
- ```
87
-
88
- **Replace the example addresses and tags with your platform's values.** These images are placeholders, not publicly available toolkit images. The Python image needs Python, Git, uv, the matching toolkit, and your internal package/CA configuration. The builder image needs Buildah and the matching Python toolkit runtime. Builder and registry settings are required by the platform schema even though this test-only example does not build or push an image.
89
-
90
- If your organization already provides a platform file or configuration source, use it. Platform maintainers can start with the [image-factory setup guide](starters/image-factory/CI-SETUP.md). Installing the CLI on your laptop does not prepare runner images.
91
-
92
- ### 3. Define the checks
93
-
94
- Create `delivery.yml` in the application repository:
95
-
96
- ```yaml
97
- version: 1
98
- projects:
99
- app:
100
- path: .
101
- python:
102
- groups: all
103
- checks:
104
- unit:
105
- script:
106
- - uv run --no-sync pytest
107
- workflows:
108
- push:
109
- checks: [unit]
110
- merge-request:
111
- checks: [unit]
93
+ ```sh
94
+ generic-ci setup
112
95
  ```
113
96
 
114
- `path` is relative to the repository root. Commands run in that project directory. Python dependency preparation uses the committed lockfile; `--no-sync` prevents the test command from resynchronizing the environment. With `groups: all`, dependency groups must be mutually compatible.
97
+ Setup guides you through organization templates or standalone configuration, previews files before writing, and includes local editor schemas. Start with its single-app configuration and add projects as needed, or choose an organization template for your monorepo. See the [setup guide](docs/setup-revision-one.md) for prepared images, unattended options, and editor integration.
115
98
 
116
- This configuration selects `unit` for push and merge-request workflows. Push pipelines are suppressed when an open MR takes their place. It does not publish a package, build an image, or deploy an application.
117
-
118
- ### 4. Validate, inspect, and generate
119
-
120
- Run these commands from the application repository using the installed CLI:
99
+ After editing your configuration:
121
100
 
122
101
  ```sh
123
102
  generic-ci validate
124
- generic-ci explain -o ci-explain.json
125
103
  generic-ci render -o .gitlab-ci.yml
126
- generic-ci render --check -o .gitlab-ci.yml
127
104
  ```
128
105
 
129
- Review `ci-explain.json` and the generated jobs, then commit `delivery.yml`, `ci-platform.yml`, and `.gitlab-ci.yml`. The explanation file is optional diagnostic output.
106
+ Review and commit `delivery.yml`, your platform configuration, and the generated `.gitlab-ci.yml` together. Validate the generated pipeline with your GitLab CI Lint, then push your branch.
107
+
108
+ **Prefer autocomplete?** Setup exports the schemas automatically. You can also refresh them from the installed CLI:
130
109
 
131
- Validate the generated YAML with **your GitLab CI Lint**, push the branch, and inspect the first pipeline. Local validation checks configuration and the job graph; it does not run pytest or check that a registry image exists. Your runner must match the configured tags and be able to pull the runtime image and reach the configured internal services.
110
+ ```sh
111
+ generic-ci schema -o .generic-ci/delivery.schema.json
112
+ generic-ci schema --platform-schema -o .generic-ci/platform.schema.json
113
+ ```
132
114
 
133
- After changing a command, platform setting, or source lock, render again. Use `generic-ci render --check -o .gitlab-ci.yml` in CI to detect stale generated YAML.
115
+ Associate them with `delivery.yml` and `ci-platform.yml` in your editor. The [editor guide](docs/setup-revision-one.md#editor-completion-and-validation) includes PyCharm instructions.
134
116
 
135
117
  ## Add the delivery features you need
136
118
 
@@ -1,3 +1,3 @@
1
1
  """Public configuration compiler. Runtime images must carry this exact version."""
2
2
 
3
- __version__ = "0.3.3"
3
+ __version__ = "0.3.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: generic-gitlab-cicd
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Validated project configuration and reproducible GitLab delivery pipelines
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -19,129 +19,111 @@ The package is named `generic-gitlab-cicd`; the command is `generic-ci`. GitLab
19
19
 
20
20
  [Quick start](#quick-start) · [Workflow guide](docs/workflows-revision-one.md) · [CLI reference](docs/cli-reference.md) · [Examples](examples/workflows) · [Documentation](docs/README.md)
21
21
 
22
- ## Why use it?
22
+ ## One repository. Tests, packages, and deployment.
23
23
 
24
- Use this toolkit when several services or repositories share delivery conventions, but each team needs to choose its own checks and release behavior.
24
+ Keep your shared Python package and API together. Generic CI tests them, publishes the package on release, and deploys the API to OpenShift.
25
25
 
26
- - **Keep application intent readable.** Name your checks and select them for pushes, merge requests, releases, manual pipelines, or schedules. The toolkit does not insert an assumed test suite.
27
- - **Reuse platform configuration.** Share runner tags, prepared images, registries, and deployment targets through organization defaults and Git-backed templates.
28
- - **Connect monorepo work explicitly.** Declare which projects are affected by upstream changes and which jobs need upstream artifacts. Artifact receipts verify the producing commit, pipeline, configuration, and file checksums.
29
- - **Support internal infrastructure.** Use prepared runtime images, internal package services, and cached configuration sources. Consumer jobs have no automatic public toolkit bootstrap.
30
- - **Review generated changes before execution.** Commit the generated YAML alongside its inputs; validate configuration and detect generation drift locally or in CI.
31
-
32
- For a repository with a few standalone jobs, handwritten GitLab CI may be sufficient. This toolkit is most useful when repeated release, dependency, and deployment rules are becoming difficult to maintain consistently.
33
-
34
- ## How it works
35
-
36
- | File | What belongs here |
37
- | --- | --- |
38
- | `delivery.yml` | Projects, commands, workflow selection, builds, and deployments |
39
- | `ci-platform.yml` | Runtime images, runner tags, registry locations, and deployment targets |
40
- | `.gitlab-ci.yml` | Generated pipeline; regenerate after editing the inputs |
41
- | `generic-ci.yml` + `generic-ci.lock.json` | Optional organization source configuration and its pinned commit |
42
-
43
- Run `generic-ci validate`, inspect `generic-ci explain`, then run `generic-ci render`. Commit the inputs and generated pipeline together. GitLab executes a planner and the selected runtime jobs using your prepared images.
44
-
45
- ## Quick start
46
-
47
- Install the CLI as shown below, then run **`generic-ci setup`** from your application repository. It walks you through organization templates or standalone configuration, validates the result, and previews files before writing. It never overwrites existing files or installs a pre-commit hook.
26
+ ```yaml
27
+ version: 1
48
28
 
49
- ```sh
50
- generic-ci setup
29
+ projects:
30
+ sdk:
31
+ path: packages/sdk
32
+ python: {}
33
+ checks:
34
+ tests:
35
+ script: [uv run --no-sync pytest]
36
+ package:
37
+ index: internal
38
+ release:
39
+ tag: v{version}
40
+ workflows:
41
+ merge-request:
42
+ checks: [tests]
43
+ release:
44
+ checks: [tests]
45
+ publish: true
46
+
47
+ api:
48
+ path: services/api
49
+ depends-on: [sdk]
50
+ python: {}
51
+ checks:
52
+ tests:
53
+ script: [uv run --no-sync pytest]
54
+ container:
55
+ dockerfile: Dockerfile
56
+ release:
57
+ tag: v{version}
58
+ needs: [sdk]
59
+ workflows:
60
+ merge-request:
61
+ checks: [tests]
62
+ release:
63
+ checks: [tests]
64
+ build: [container]
65
+
66
+ deployments:
67
+ api:
68
+ target: production
69
+ chart:
70
+ path: deploy/chart
71
+ values: [deploy/values.yaml]
72
+ images:
73
+ - from: api.build-image
74
+ set:
75
+ repository: apps.api.image.repository
76
+ tag: apps.api.image.tag
77
+ workflows:
78
+ release:
79
+ when: manual
51
80
  ```
52
81
 
53
- Organization mode asks for a Git configuration repository (GitHub or GitLab), revision, template, and application settings. Standalone mode detects the ecosystem, asks for your existing test command and runtime infrastructure, and optionally creates a manual OpenShift MR preview with `deploy/values.yaml`. The chart must already be published and compatible with generic-app 2.x; setup does not provision infrastructure.
82
+ **What you get:**
54
83
 
55
- Both paths write the generated pipeline, setup notes, and local editor schemas. See [setup and editor integration](docs/setup-revision-one.md) for unattended flags, dry runs, schema mappings, and limitations.
84
+ - **On merge requests:** test affected projects. SDK changes also select the API for testing.
85
+ - **On a release tag:** run checks, publish the SDK, and build the API image. The API release depends on SDK publication; its tests and image build can run independently.
86
+ - **When you approve deployment:** deploy the built API image through Helm to OpenShift.
56
87
 
57
- The following manual walkthrough explains the files setup produces and remains useful when editing an existing configuration.
88
+ Both projects use a shared version: projects at `1.2.0` release under the protected tag `v1.2.0`. Dependency installation follows each project's declared dependencies and committed lockfile; `depends-on` selects work, not package replacements.
58
89
 
59
- This example adds push and merge-request tests to an **existing Python project**. It assumes the repository already has a `pyproject.toml`, a committed `uv.lock`, and pytest declared in a dependency group. Replace the test command if your project uses something else.
90
+ Your organization supplies prepared runtime images, registry settings, and the production target in `ci-platform.yml`. The application's `deploy/chart` and `deploy/values.yaml` describe the deployment. Start with the [shared chart](charts/generic-app) and [values example](examples/helm-values.yaml); configure the named `internal` publishing index and CI credentials through your platform.
60
91
 
61
- ### 1. Install the CLI
92
+ ## Quick start
62
93
 
63
- Use Python **3.11 or newer**. From a checkout of this repository, install into an isolated environment:
94
+ Use Python **3.11 or newer**. From a checkout of this toolkit, install the CLI into an isolated environment:
64
95
 
65
96
  ```sh
66
97
  python -m venv .venv
67
98
  . .venv/bin/activate
68
99
  python -m pip install .
69
- generic-ci --help
70
100
  ```
71
101
 
72
- For repeatable organization setup, distribute a versioned wheel through your approved internal package index or wheelhouse. Keep the authoring CLI and the toolkit installed in runner images on the **same version**. This source revision is **0.3.3**; source availability does not imply that version has been published to PyPI.
73
-
74
- The install command uses your configured package sources. In an air-gapped environment, prepare the wheel and all dependencies internally first.
75
-
76
- ### 2. Provide the runtime configuration
102
+ Then, from your application repository:
77
103
 
78
- In your **application repository**, create `ci-platform.yml`:
79
-
80
- ```yaml
81
- version: 1
82
- defaults:
83
- tags: [internal-linux]
84
- images:
85
- python: registry.example.internal/ci/python-toolkit:0.3.3
86
- container-builder:
87
- engine: buildah
88
- image: registry.example.internal/ci/buildah-toolkit:0.3.3
89
- registries:
90
- containers: registry.example.internal/apps
91
- previews: registry.example.internal/previews
92
- allowed-hosts:
93
- - registry.example.internal
94
- - gitlab.example.internal
95
- variables:
96
- UV_PYTHON_DOWNLOADS: never
97
- ```
98
-
99
- **Replace the example addresses and tags with your platform's values.** These images are placeholders, not publicly available toolkit images. The Python image needs Python, Git, uv, the matching toolkit, and your internal package/CA configuration. The builder image needs Buildah and the matching Python toolkit runtime. Builder and registry settings are required by the platform schema even though this test-only example does not build or push an image.
100
-
101
- If your organization already provides a platform file or configuration source, use it. Platform maintainers can start with the [image-factory setup guide](starters/image-factory/CI-SETUP.md). Installing the CLI on your laptop does not prepare runner images.
102
-
103
- ### 3. Define the checks
104
-
105
- Create `delivery.yml` in the application repository:
106
-
107
- ```yaml
108
- version: 1
109
- projects:
110
- app:
111
- path: .
112
- python:
113
- groups: all
114
- checks:
115
- unit:
116
- script:
117
- - uv run --no-sync pytest
118
- workflows:
119
- push:
120
- checks: [unit]
121
- merge-request:
122
- checks: [unit]
104
+ ```sh
105
+ generic-ci setup
123
106
  ```
124
107
 
125
- `path` is relative to the repository root. Commands run in that project directory. Python dependency preparation uses the committed lockfile; `--no-sync` prevents the test command from resynchronizing the environment. With `groups: all`, dependency groups must be mutually compatible.
108
+ Setup guides you through organization templates or standalone configuration, previews files before writing, and includes local editor schemas. Start with its single-app configuration and add projects as needed, or choose an organization template for your monorepo. See the [setup guide](docs/setup-revision-one.md) for prepared images, unattended options, and editor integration.
126
109
 
127
- This configuration selects `unit` for push and merge-request workflows. Push pipelines are suppressed when an open MR takes their place. It does not publish a package, build an image, or deploy an application.
128
-
129
- ### 4. Validate, inspect, and generate
130
-
131
- Run these commands from the application repository using the installed CLI:
110
+ After editing your configuration:
132
111
 
133
112
  ```sh
134
113
  generic-ci validate
135
- generic-ci explain -o ci-explain.json
136
114
  generic-ci render -o .gitlab-ci.yml
137
- generic-ci render --check -o .gitlab-ci.yml
138
115
  ```
139
116
 
140
- Review `ci-explain.json` and the generated jobs, then commit `delivery.yml`, `ci-platform.yml`, and `.gitlab-ci.yml`. The explanation file is optional diagnostic output.
117
+ Review and commit `delivery.yml`, your platform configuration, and the generated `.gitlab-ci.yml` together. Validate the generated pipeline with your GitLab CI Lint, then push your branch.
118
+
119
+ **Prefer autocomplete?** Setup exports the schemas automatically. You can also refresh them from the installed CLI:
141
120
 
142
- Validate the generated YAML with **your GitLab CI Lint**, push the branch, and inspect the first pipeline. Local validation checks configuration and the job graph; it does not run pytest or check that a registry image exists. Your runner must match the configured tags and be able to pull the runtime image and reach the configured internal services.
121
+ ```sh
122
+ generic-ci schema -o .generic-ci/delivery.schema.json
123
+ generic-ci schema --platform-schema -o .generic-ci/platform.schema.json
124
+ ```
143
125
 
144
- After changing a command, platform setting, or source lock, render again. Use `generic-ci render --check -o .gitlab-ci.yml` in CI to detect stale generated YAML.
126
+ Associate them with `delivery.yml` and `ci-platform.yml` in your editor. The [editor guide](docs/setup-revision-one.md#editor-completion-and-validation) includes PyCharm instructions.
145
127
 
146
128
  ## Add the delivery features you need
147
129
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "generic-gitlab-cicd"
7
- version = "0.3.3"
7
+ version = "0.3.4"
8
8
  description = "Validated project configuration and reproducible GitLab delivery pipelines"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"