Skip to content

Commit 66c7554

Browse files
authored
Merge branch 'main' into renovate/go-1.x
2 parents 08d3826 + 01d5194 commit 66c7554

File tree

106 files changed

+10495
-11092
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+10495
-11092
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv

.github/renovate/matchOpenStackHelm.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@
33
"customManagers": [
44
{
55
"customType": "regex",
6-
"fileMatch": ["apps.*\\.ya?ml$"],
6+
"managerFilePatterns": [
7+
"/apps.*\\.ya?ml$/"
8+
],
79
"matchStrings": [
8-
"component:\\s['\"]?(?<depName>.*?)['\"]?\\s*(repoUrl:\\s['\"]?(?<repoUrl>.*?)['\"]\\s*)?chartVersion:\\s['\"]?(?<currentValue>.*?)['\"]?"
10+
"component:\\s['\"]?(?<depName>[\\w\\-]+)['\"]?\\s*(repoURL:\\s['\"]?(?<repoUrl>[\\w:\/\\-\\.]+)['\"]?\\s*)?chartVersion:\\s['\"]?(?<currentValue>[\\w\\.\\-\\+]+)['\"]?"
911
],
1012
"datasourceTemplate": "helm",
1113
"registryUrlTemplate": "{{#if repoUrl }}{{repoUrl}}{{else}}https://tarballs.opendev.org/openstack/openstack-helm{{/if}}",
12-
"packageNameTemplate": "openstack-helm/{{depName}}",
14+
"depNameTemplate": "openstack-helm/{{depName}}",
15+
"packageNameTemplate": "{{depName}}",
1316
"versioningTemplate": "helm"
1417
}
15-
],
16-
"packageRules": [
17-
{
18-
"matchPackageNames": ["openstack-helm/**"],
19-
"groupName": "openstack-helm"
20-
}
2118
]
2219
}

.github/workflows/build-container-images.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3232
- name: Set up Docker Buildx
33-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
33+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
3434

3535
- name: Login to ghcr.io
3636
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3

.github/workflows/build-dexop.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2020
- name: Set up Docker Buildx
21-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
21+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
2222

2323
- name: Login to ghcr.io
2424
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3

.github/workflows/build-ironic-images.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129

130130
- name: Publish Release
131131
id: create_release
132-
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2
132+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2
133133
with:
134134
name: understack-images
135135
tag_name: understack-images-${{ env.TIMESTAMP }}

.github/workflows/code-test.yaml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,49 @@ concurrency:
2020
group: ${{ github.workflow }}-${{ github.ref }}
2121

2222
jobs:
23-
python:
23+
discover:
24+
runs-on: ubuntu-latest
25+
outputs:
26+
projects: ${{ steps.set-projects.outputs.projects }}
27+
steps:
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
29+
- name: Find all projects with pyproject.toml
30+
id: set-projects
31+
run: |
32+
# grabs all paths with pyproject.toml, snips the 2nd dir, grabs only unique ones, makes a JSON list
33+
projects=$(find python -mindepth 2 ! -wholename 'python/understack-tests/*' -name pyproject.toml | awk -F/ '{print $2}' | sort -u | jq -R -s -c 'split("\n")[:-1]')
34+
echo "projects=$projects" >> "$GITHUB_OUTPUT"
35+
36+
uv:
37+
needs: [discover]
2438
runs-on: ubuntu-latest
2539

2640
strategy:
2741
matrix:
28-
project:
29-
- understack-workflows
30-
- understack-flavor-matcher
31-
- neutron-understack
42+
project: ${{ fromJson(needs.discover.outputs.projects) }}
3243

3344
defaults:
3445
run:
3546
working-directory: ./python/${{ matrix.project }}
3647

3748
steps:
3849
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
39-
- run: pipx install poetry==1.7.1 && poetry self add 'poetry-dynamic-versioning[plugin]'
40-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
50+
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6
51+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
4152
with:
4253
python-version-file: python/${{ matrix.project }}/pyproject.toml
43-
cache: "poetry"
44-
- run: poetry install --sync --with test
45-
- run: poetry build
46-
- run: "poetry run pytest --cov --cov-report xml:coverage.xml"
47-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
54+
- run: uv sync
55+
- run: uv build --wheel
56+
- run: "uv run pytest --cov --cov-report xml:coverage.xml"
57+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
4858
with:
4959
name: coverage-${{ matrix.project }}
5060
path: python/${{ matrix.project }}/coverage.xml
5161
retention-days: 1
5262

63+
5364
coverage-upload:
54-
needs: python
65+
needs: [uv]
5566
runs-on: ubuntu-latest
5667
steps:
5768
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4

.github/workflows/containers.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
steps:
3939
- name: setup docker buildx
40-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
40+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
4141
- name: login to ghcr.io
4242
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
4343
with:
@@ -80,7 +80,7 @@ jobs:
8080

8181
steps:
8282
- name: setup docker buildx
83-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
83+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
8484
- name: login to ghcr.io
8585
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
8686
with:
@@ -126,10 +126,11 @@ jobs:
126126
- name: ironic-nautobot-client
127127
- name: nova-flavors
128128
- name: ansible
129+
- name: understack-tests
129130

130131
steps:
131132
- name: setup docker buildx
132-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
133+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
133134
- name: login to ghcr.io
134135
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
135136
with:
@@ -186,6 +187,7 @@ jobs:
186187
- ironic-nautobot-client
187188
- nova-flavors
188189
- ansible
190+
- understack-tests
189191

190192
steps:
191193
- name: clean up PR container

.github/workflows/mkdocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3232
- name: markdownlint
33-
uses: nosborn/github-action-markdown-cli@58bcfd1af530d87a13d51b76e6713b52602e3613 # v3.4.0
33+
uses: nosborn/github-action-markdown-cli@508d6cefd8f0cc99eab5d2d4685b1d5f470042c1 # v3.5.0
3434
with:
3535
files: docs
3636
config_file: .markdownlint.yml
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Check for ephemeral PR images
2+
on:
3+
# push:
4+
pull_request:
5+
6+
7+
jobs:
8+
check-files:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
13+
14+
- name: Check files matching glob patterns for pr-\d+ pattern
15+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
16+
with:
17+
script: |
18+
const fs = require('fs');
19+
const prPattern = /ghcr\.io\/rackerlabs\/understack.*pr-\d+/
20+
21+
// Define glob patterns for files to check for reference to PR images
22+
const globPatterns = [
23+
'**/*.yml',
24+
'**/*.yaml',
25+
'**/Dockerfile*',
26+
'**/.env*',
27+
];
28+
29+
// Exclude files from checks
30+
const excludePatterns = [
31+
'!**/.git/**',
32+
'!**/docs/**',
33+
'!**/ansible/**'
34+
];
35+
36+
// Combine include and exclude patterns
37+
const allPatterns = [...globPatterns, ...excludePatterns];
38+
39+
core.info('Inspecting files matching following glob patterns:');
40+
globPatterns.forEach(pattern => core.info(` Include: ${pattern}`));
41+
excludePatterns.forEach(pattern => core.info(` Exclude: ${pattern}`));
42+
core.info('');
43+
44+
const globber = await glob.create(allPatterns.join('\n'));
45+
const filesToCheck = await globber.glob();
46+
47+
core.info(`Found ${filesToCheck.length} files matching glob patterns:`);
48+
filesToCheck.forEach(file => core.debug(` - ${file}`));
49+
core.debug('');
50+
51+
let hasPatternMatch = false;
52+
const matchedFiles = [];
53+
54+
for (const filePath of filesToCheck) {
55+
try {
56+
const fileContent = fs.readFileSync(filePath, 'utf8');
57+
58+
if (prPattern.test(fileContent)) {
59+
hasPatternMatch = true;
60+
matchedFiles.push(filePath);
61+
core.error(`❌ Ephemeral container image reference found in: ${filePath}`);
62+
} else {
63+
core.debug(`✅ No pattern found in: ${filePath}`);
64+
}
65+
} catch (error) {
66+
core.info(`Error reading file ${filePath}: ${error.message}`);
67+
}
68+
}
69+
70+
if (hasPatternMatch) {
71+
core.setFailed(`Pattern 'pr-\\d+' found in ${matchedFiles.length} files: ${matchedFiles.join(', ')}`);
72+
core.info(`Please switch to a different tag before merging as this container image will not be available after PR is merged`)
73+
core.info(`Alternatively, if this is intended, edit .github/workflows/no-pr-images.yaml -> excludePatterns.`)
74+
} else {
75+
core.info(`✅ All ${filesToCheck.length} files checked - no pr-\\d+ pattern found`);
76+
}

.github/workflows/understackctl-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
make build-all package-all checksums
3939
4040
- name: Upload release artifacts
41-
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2
41+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2
4242
with:
4343
files: |
4444
go/understackctl/build/*.zip

0 commit comments

Comments
 (0)