yardmaster 0.1.0__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 (38) hide show
  1. yardmaster-0.1.0/LICENSE +202 -0
  2. yardmaster-0.1.0/PKG-INFO +185 -0
  3. yardmaster-0.1.0/README.md +140 -0
  4. yardmaster-0.1.0/pyproject.toml +93 -0
  5. yardmaster-0.1.0/setup.cfg +4 -0
  6. yardmaster-0.1.0/tests/test_jenkins.py +17 -0
  7. yardmaster-0.1.0/tests/test_release.py +38 -0
  8. yardmaster-0.1.0/tests/test_version.py +25 -0
  9. yardmaster-0.1.0/yardmaster/__init__.py +8 -0
  10. yardmaster-0.1.0/yardmaster/__main__.py +4 -0
  11. yardmaster-0.1.0/yardmaster/cli.py +74 -0
  12. yardmaster-0.1.0/yardmaster/commands/__init__.py +0 -0
  13. yardmaster-0.1.0/yardmaster/commands/epoch.py +28 -0
  14. yardmaster-0.1.0/yardmaster/commands/jenkins.py +58 -0
  15. yardmaster-0.1.0/yardmaster/commands/release.py +327 -0
  16. yardmaster-0.1.0/yardmaster/commands/retag.py +71 -0
  17. yardmaster-0.1.0/yardmaster/commands/sdk.py +98 -0
  18. yardmaster-0.1.0/yardmaster/commands/status.py +113 -0
  19. yardmaster-0.1.0/yardmaster/config.py +127 -0
  20. yardmaster-0.1.0/yardmaster/core/__init__.py +0 -0
  21. yardmaster-0.1.0/yardmaster/core/release.py +266 -0
  22. yardmaster-0.1.0/yardmaster/core/state.py +54 -0
  23. yardmaster-0.1.0/yardmaster/core/validator.py +34 -0
  24. yardmaster-0.1.0/yardmaster/core/version.py +54 -0
  25. yardmaster-0.1.0/yardmaster/services/__init__.py +0 -0
  26. yardmaster-0.1.0/yardmaster/services/git.py +76 -0
  27. yardmaster-0.1.0/yardmaster/services/jenkins.py +190 -0
  28. yardmaster-0.1.0/yardmaster/services/runner.py +66 -0
  29. yardmaster-0.1.0/yardmaster/services/sdk.py +136 -0
  30. yardmaster-0.1.0/yardmaster/utils/__init__.py +0 -0
  31. yardmaster-0.1.0/yardmaster/utils/http.py +32 -0
  32. yardmaster-0.1.0/yardmaster/utils/logger.py +18 -0
  33. yardmaster-0.1.0/yardmaster.egg-info/PKG-INFO +185 -0
  34. yardmaster-0.1.0/yardmaster.egg-info/SOURCES.txt +36 -0
  35. yardmaster-0.1.0/yardmaster.egg-info/dependency_links.txt +1 -0
  36. yardmaster-0.1.0/yardmaster.egg-info/entry_points.txt +2 -0
  37. yardmaster-0.1.0/yardmaster.egg-info/requires.txt +21 -0
  38. yardmaster-0.1.0/yardmaster.egg-info/top_level.txt +1 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,185 @@
1
+ Metadata-Version: 2.4
2
+ Name: yardmaster
3
+ Version: 0.1.0
4
+ Summary: Flatcar Container Linux Release Management Tool
5
+ Author-email: Flatcar Team <flatcar-linux-user@googlegroups.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/flatcar/yardmaster
8
+ Project-URL: Documentation, https://github.com/flatcar/yardmaster/docs
9
+ Project-URL: Repository, https://github.com/flatcar/yardmaster
10
+ Project-URL: Issues, https://github.com/flatcar/yardmaster/issues
11
+ Keywords: flatcar,release,automation,linux,containers
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Build Tools
20
+ Classifier: Topic :: System :: Operating System
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: click>=8.1.0
25
+ Requires-Dist: requests>=2.31.0
26
+ Requires-Dist: pyyaml>=6.0
27
+ Requires-Dist: rich>=13.0.0
28
+ Requires-Dist: python-jenkins>=1.8.0
29
+ Requires-Dist: gitpython>=3.1.0
30
+ Requires-Dist: pydantic>=2.0.0
31
+ Requires-Dist: tabulate>=0.9.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
34
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
35
+ Requires-Dist: pytest-mock>=3.11.0; extra == "dev"
36
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
37
+ Requires-Dist: mypy>=1.5.0; extra == "dev"
38
+ Requires-Dist: sphinx>=7.0.0; extra == "dev"
39
+ Requires-Dist: sphinx-autobuild>=2024.0.0; extra == "dev"
40
+ Requires-Dist: shibuya>=2024.0.0; extra == "dev"
41
+ Requires-Dist: types-requests>=2.31.0; extra == "dev"
42
+ Requires-Dist: types-PyYAML>=6.0.0; extra == "dev"
43
+ Requires-Dist: types-tabulate>=0.9.0; extra == "dev"
44
+ Dynamic: license-file
45
+
46
+ # Yardmaster
47
+
48
+ Yardmaster is a release management tool for Flatcar Container Linux. It automates release orchestration across multiple channels (Alpha, Beta, Stable, LTS) and provides commands to prepare, validate, and tag releases.
49
+
50
+ ## Requirements
51
+
52
+ - Python 3.10+
53
+ - `uv` for environment and dependency management
54
+
55
+ ## Setup
56
+
57
+ ```bash
58
+ # Install dependencies
59
+ make dev-install
60
+
61
+ # Copy and edit the config file
62
+ cp .yardmaster.yaml.sample .yardmaster.yaml
63
+ # Edit .yardmaster.yaml with your values
64
+ ```
65
+
66
+ ### Required environment variables
67
+
68
+ The config template references these env vars:
69
+
70
+ - `JENKINS_USER` and `JENKINS_TOKEN` for Jenkins
71
+ - `GPG_KEY_ID` if GPG signing is enabled
72
+
73
+ Export them before running release commands.
74
+
75
+ ## Release workflow
76
+
77
+ ```bash
78
+ # 1. Initialize release state from a GitHub issue
79
+ yardmaster release init https://github.com/flatcar/Flatcar/issues/1234
80
+
81
+ # 2. Check status
82
+ yardmaster status
83
+
84
+ # 3. Run pre-release steps (tagging, branching, Jenkins builds)
85
+ yardmaster release run --pre
86
+
87
+ # 4. Run post-release steps
88
+ yardmaster release run --post
89
+
90
+ # 5. Mark release as done
91
+ yardmaster release complete
92
+ ```
93
+
94
+ Use `--dry-run` on any step to preview without making changes.
95
+
96
+ Useful options:
97
+
98
+ - `--dry-run`: show actions without executing them
99
+ - `--skip-jenkins`: skip triggering Jenkins builds
100
+ - `--skip-issue-check`: skip GitHub issue title verification
101
+ - `--force`: force tag creation if it already exists
102
+ - `-v`: verbose logging
103
+
104
+ ### Retag
105
+
106
+ Retag a channel mid-release:
107
+
108
+ ```bash
109
+ yardmaster retag alpha
110
+ ```
111
+
112
+ ### Status
113
+
114
+ View configured channels, planned releases, and release state:
115
+
116
+ ```bash
117
+ yardmaster status
118
+ yardmaster status --show-sdk
119
+ yardmaster status --json
120
+ ```
121
+
122
+ ### SDK
123
+
124
+ Determine SDK versions for upcoming releases:
125
+
126
+ ```bash
127
+ yardmaster sdk determine alpha:3800.0.0
128
+ ```
129
+
130
+ ### Jenkins
131
+
132
+ Trigger a Jenkins PR build:
133
+
134
+ ```bash
135
+ yardmaster jenkins pr-build --dry-run flatcar scripts 1234
136
+ ```
137
+
138
+ ## Development
139
+
140
+ ```bash
141
+ make dev-install # install dev dependencies
142
+ make test # run tests
143
+ make lint # lint
144
+ make format # auto-format
145
+ make type-check # mypy
146
+ make check # all of the above
147
+ make fix # auto-fix formatting + lint
148
+ make all # fix + check + build
149
+ make clean # remove build artifacts
150
+ make help # list all targets
151
+ ```
152
+
153
+ ## Notes
154
+
155
+ - Default config path: `.yardmaster.yaml`
156
+ - Sample config: `.yardmaster.yaml.sample`
157
+ - Workspace default: `~/.yardmaster/workspace`
158
+ - Logs default: `~/.yardmaster/yardmaster.log`
159
+
160
+ ## Troubleshooting
161
+
162
+ If you see `Config file not found`, copy the sample config:
163
+
164
+ ```bash
165
+ cp .yardmaster.yaml.sample .yardmaster.yaml
166
+ ```
167
+
168
+ Then edit it with your values.
169
+
170
+ ## Configuration
171
+
172
+ Yardmaster looks for `.yardmaster.yaml` in the current directory by default. You can override this with:
173
+
174
+ - **`YARDMASTER_CONFIG`** environment variable:
175
+
176
+ ```bash
177
+ export YARDMASTER_CONFIG=~/my-project/.yardmaster.yaml
178
+ yardmaster status
179
+ ```
180
+
181
+ - **`-c` flag** (takes precedence over the env var):
182
+
183
+ ```bash
184
+ yardmaster -c /path/to/config.yaml status
185
+ ```
@@ -0,0 +1,140 @@
1
+ # Yardmaster
2
+
3
+ Yardmaster is a release management tool for Flatcar Container Linux. It automates release orchestration across multiple channels (Alpha, Beta, Stable, LTS) and provides commands to prepare, validate, and tag releases.
4
+
5
+ ## Requirements
6
+
7
+ - Python 3.10+
8
+ - `uv` for environment and dependency management
9
+
10
+ ## Setup
11
+
12
+ ```bash
13
+ # Install dependencies
14
+ make dev-install
15
+
16
+ # Copy and edit the config file
17
+ cp .yardmaster.yaml.sample .yardmaster.yaml
18
+ # Edit .yardmaster.yaml with your values
19
+ ```
20
+
21
+ ### Required environment variables
22
+
23
+ The config template references these env vars:
24
+
25
+ - `JENKINS_USER` and `JENKINS_TOKEN` for Jenkins
26
+ - `GPG_KEY_ID` if GPG signing is enabled
27
+
28
+ Export them before running release commands.
29
+
30
+ ## Release workflow
31
+
32
+ ```bash
33
+ # 1. Initialize release state from a GitHub issue
34
+ yardmaster release init https://github.com/flatcar/Flatcar/issues/1234
35
+
36
+ # 2. Check status
37
+ yardmaster status
38
+
39
+ # 3. Run pre-release steps (tagging, branching, Jenkins builds)
40
+ yardmaster release run --pre
41
+
42
+ # 4. Run post-release steps
43
+ yardmaster release run --post
44
+
45
+ # 5. Mark release as done
46
+ yardmaster release complete
47
+ ```
48
+
49
+ Use `--dry-run` on any step to preview without making changes.
50
+
51
+ Useful options:
52
+
53
+ - `--dry-run`: show actions without executing them
54
+ - `--skip-jenkins`: skip triggering Jenkins builds
55
+ - `--skip-issue-check`: skip GitHub issue title verification
56
+ - `--force`: force tag creation if it already exists
57
+ - `-v`: verbose logging
58
+
59
+ ### Retag
60
+
61
+ Retag a channel mid-release:
62
+
63
+ ```bash
64
+ yardmaster retag alpha
65
+ ```
66
+
67
+ ### Status
68
+
69
+ View configured channels, planned releases, and release state:
70
+
71
+ ```bash
72
+ yardmaster status
73
+ yardmaster status --show-sdk
74
+ yardmaster status --json
75
+ ```
76
+
77
+ ### SDK
78
+
79
+ Determine SDK versions for upcoming releases:
80
+
81
+ ```bash
82
+ yardmaster sdk determine alpha:3800.0.0
83
+ ```
84
+
85
+ ### Jenkins
86
+
87
+ Trigger a Jenkins PR build:
88
+
89
+ ```bash
90
+ yardmaster jenkins pr-build --dry-run flatcar scripts 1234
91
+ ```
92
+
93
+ ## Development
94
+
95
+ ```bash
96
+ make dev-install # install dev dependencies
97
+ make test # run tests
98
+ make lint # lint
99
+ make format # auto-format
100
+ make type-check # mypy
101
+ make check # all of the above
102
+ make fix # auto-fix formatting + lint
103
+ make all # fix + check + build
104
+ make clean # remove build artifacts
105
+ make help # list all targets
106
+ ```
107
+
108
+ ## Notes
109
+
110
+ - Default config path: `.yardmaster.yaml`
111
+ - Sample config: `.yardmaster.yaml.sample`
112
+ - Workspace default: `~/.yardmaster/workspace`
113
+ - Logs default: `~/.yardmaster/yardmaster.log`
114
+
115
+ ## Troubleshooting
116
+
117
+ If you see `Config file not found`, copy the sample config:
118
+
119
+ ```bash
120
+ cp .yardmaster.yaml.sample .yardmaster.yaml
121
+ ```
122
+
123
+ Then edit it with your values.
124
+
125
+ ## Configuration
126
+
127
+ Yardmaster looks for `.yardmaster.yaml` in the current directory by default. You can override this with:
128
+
129
+ - **`YARDMASTER_CONFIG`** environment variable:
130
+
131
+ ```bash
132
+ export YARDMASTER_CONFIG=~/my-project/.yardmaster.yaml
133
+ yardmaster status
134
+ ```
135
+
136
+ - **`-c` flag** (takes precedence over the env var):
137
+
138
+ ```bash
139
+ yardmaster -c /path/to/config.yaml status
140
+ ```
@@ -0,0 +1,93 @@
1
+ [project]
2
+ name = "yardmaster"
3
+ version = "0.1.0"
4
+ description = "Flatcar Container Linux Release Management Tool"
5
+ authors = [
6
+ {name = "Flatcar Team", email = "flatcar-linux-user@googlegroups.com"}
7
+ ]
8
+ readme = "README.md"
9
+ license = "Apache-2.0"
10
+ license-files = ["LICENSE"]
11
+ requires-python = ">=3.9"
12
+ keywords = ["flatcar", "release", "automation", "linux", "containers"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Intended Audience :: Developers",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.9",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Topic :: Software Development :: Build Tools",
22
+ "Topic :: System :: Operating System",
23
+ ]
24
+
25
+ dependencies = [
26
+ "click>=8.1.0",
27
+ "requests>=2.31.0",
28
+ "pyyaml>=6.0",
29
+ "rich>=13.0.0",
30
+ "python-jenkins>=1.8.0",
31
+ "gitpython>=3.1.0",
32
+ "pydantic>=2.0.0",
33
+ "tabulate>=0.9.0",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=7.4.0",
39
+ "pytest-cov>=4.1.0",
40
+ "pytest-mock>=3.11.0",
41
+ "ruff>=0.1.0",
42
+ "mypy>=1.5.0",
43
+ "sphinx>=7.0.0",
44
+ "sphinx-autobuild>=2024.0.0",
45
+ "shibuya>=2024.0.0",
46
+ "types-requests>=2.31.0",
47
+ "types-PyYAML>=6.0.0",
48
+ "types-tabulate>=0.9.0",
49
+ ]
50
+
51
+ [project.urls]
52
+ Homepage = "https://github.com/flatcar/yardmaster"
53
+ Documentation = "https://github.com/flatcar/yardmaster/docs"
54
+ Repository = "https://github.com/flatcar/yardmaster"
55
+ Issues = "https://github.com/flatcar/yardmaster/issues"
56
+
57
+ [project.scripts]
58
+ yardmaster = "yardmaster.cli:cli"
59
+
60
+ [build-system]
61
+ requires = ["setuptools>=68.0", "wheel"]
62
+ build-backend = "setuptools.build_meta"
63
+
64
+ [tool.setuptools.packages.find]
65
+ where = ["."]
66
+ include = ["yardmaster*"]
67
+ exclude = ["tests*"]
68
+
69
+ [tool.pytest.ini_options]
70
+ testpaths = ["tests"]
71
+ python_files = ["test_*.py"]
72
+ python_classes = ["Test*"]
73
+ python_functions = ["test_*"]
74
+ addopts = "-v --tb=short"
75
+
76
+ [tool.ruff]
77
+ line-length = 100
78
+ target-version = "py39"
79
+
80
+ [tool.ruff.lint]
81
+ select = ["E", "F", "I", "N", "W", "UP"]
82
+ ignore = ["E501"]
83
+
84
+ [tool.mypy]
85
+ python_version = "3.10"
86
+ warn_return_any = true
87
+ warn_unused_configs = true
88
+ disallow_untyped_defs = true
89
+
90
+ [dependency-groups]
91
+ dev = [
92
+ "build>=1.4.2",
93
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,17 @@
1
+ from yardmaster.services.jenkins import JenkinsService
2
+
3
+
4
+ def test_build_job_url_nested_path() -> None:
5
+ svc = JenkinsService(url="http://jenkins.example", username=None, token=None)
6
+ url = svc._build_job_url("container/release")
7
+ assert url == "http://jenkins.example/job/container/job/release/buildWithParameters"
8
+
9
+
10
+ def test_build_pr_version_uses_channel_from_minor() -> None:
11
+ version = JenkinsService._build_pr_version("3600.1.0", "flatcar-master")
12
+ assert version == "beta-3600.1.101-flatcar-master"
13
+
14
+
15
+ def test_build_pr_version_uses_main_channel() -> None:
16
+ version = JenkinsService._build_pr_version("3600.2.0", "main")
17
+ assert version == "main-3600.2.101-main"
@@ -0,0 +1,38 @@
1
+ from pathlib import Path
2
+
3
+ import pytest
4
+
5
+ from yardmaster.config import Config
6
+ from yardmaster.core.release import ReleaseManager
7
+
8
+
9
+ def test_parse_specs() -> None:
10
+ specs = ReleaseManager.parse_specs(["alpha:3800.0.0", "beta:3795.1.0"])
11
+ assert specs[0].channel.value == "alpha"
12
+ assert str(specs[0].version) == "3800.0.0"
13
+ assert specs[1].channel.value == "beta"
14
+
15
+
16
+ def test_validate_unique_channels(tmp_path: Path) -> None:
17
+ scripts_dir = tmp_path / "scripts"
18
+ scripts_dir.mkdir()
19
+ cfg_text = tmp_path / ".yardmaster.yaml"
20
+ cfg_text.write_text(
21
+ f"""repositories:
22
+ scripts: https://example.invalid/scripts.git
23
+ coreos_overlay: https://example.invalid/coreos-overlay.git
24
+ portage_stable: https://example.invalid/portage-stable.git
25
+ paths:
26
+ scripts: {scripts_dir}
27
+ jenkins:
28
+ url: http://example.invalid:8080
29
+ channels:
30
+ alpha:
31
+ release_url: https://alpha.example.invalid
32
+ """
33
+ )
34
+ cfg = Config.load(cfg_text)
35
+ mgr = ReleaseManager(cfg)
36
+ specs = mgr.parse_specs(["alpha:3800.0.0", "alpha:3800.0.1"])
37
+ with pytest.raises(RuntimeError):
38
+ mgr.validate(specs)