Skip to content

Commit dbf2b74

Browse files
refactor: remove prevent-cli and flatten codecov-cli to repo root (#709)
Remove the prevent-cli sub-project entirely and move every codecov-cli/* file up to the repository root so codecov-cli is once again a top-level Python project. Layout changes: - Delete prevent-cli/. - git mv codecov-cli/{codecov_cli,tests,samples,pyproject.toml, uv.lock,setup.py,MANIFEST.in,ruff.toml,codecovcli_commands, README.md,LICENSE} to the repo root. - Replace the prevent-cli root README and LICENSE with the codecov-cli ones (they're identical, so LICENSE shows as a pure delete + retained file). Companion edits to make the flat layout build cleanly: - Makefile: drop `cd codecov-cli` from `test`, point `command_dump` at the new top-level command_dump.py. - command_dump.py: restored at the repo root, dumps only codecovcli (sentry-prevent-cli no longer exists). - hooks/pre-commit: stop staging prevent-cli/preventcli_commands. - .craft.yml: point at codecov/codecov-cli and drop the sentry_prevent_cli targets. - .github/workflows/broadcast_api_changes.yml: watch codecovcli_commands at the root. - .github/workflows/ci.yml: drop all prevent-cli/sentry-prevent-cli jobs and `cd codecov-cli`, fix repository_owner == 'codecov' so dogfood / codecov-startup jobs actually run. - .github/workflows/build.yml: build codecov-cli only, from the repo root (no more dual-CLI matrix or Cosign signing). - .github/workflows/release-codecov-cli.yml: download/publish from ./dist instead of codecov-cli/dist. - scripts/build_alpine.sh, scripts/build_linux.sh: rewritten to build codecov-cli only out of the repo root with uv. - scripts/{bump-version.sh,pre-build.sh,uv-installer-0.7.8.sha256sum}: deleted (prevent-cli specific). - tests/helpers/test_versioning_systems.py: update the exotic filename assertion from `codecov-cli/tests/data/...` to `tests/data/...` now that tests live at the root. - pyproject.toml + README.md: project URLs and badges now point at codecov/codecov-cli instead of getsentry/prevent-cli. Verified locally: `uv sync` succeeds, the full pytest suite passes (697 tests), `ruff check` is clean, and `make command_dump` produces no diff against the checked-in codecovcli_commands.
1 parent beb955d commit dbf2b74

209 files changed

Lines changed: 325 additions & 2448 deletions

File tree

Some content is hidden

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

.craft.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
github:
2-
owner: getsentry
3-
repo: prevent-cli
2+
owner: codecov
3+
repo: codecov-cli
44

55
changelogPolicy: auto
66

77
targets:
8-
# For direct binary downloads + cosign bundles
98
- name: github
109
tagPrefix: v
1110
checksums:
1211
- algorithm: sha256
13-
includeNames: /^(sentry-prevent-|sentry_prevent_|codecov|codecov_)cli.*/i
12+
includeNames: /^(codecov|codecov_)cli.*/i
1413

1514
- name: pypi
16-
includeNames: /sentry_prevent_cli-*/i
15+
includeNames: /codecov_cli-*/i

.github/workflows/broadcast_api_changes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Broadcast API changes
66
on:
77
push:
88
branches: ['main']
9-
paths: ['codecov-cli/codecovcli_commands', 'prevent-cli/preventcli_commands']
9+
paths: ['codecovcli_commands']
1010

1111
jobs:
1212
run:

.github/workflows/build.yml

Lines changed: 9 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# This workflow builds both sentry-prevent-cli and codecov-cli on push to a
2-
# release/* branch. These are later released by Craft and another workflow,
3-
# respectively.
1+
# This workflow builds codecov-cli on push to a release/* branch. The artifacts
2+
# are later picked up and released by Craft.
43
name: Build release
54

65
on:
@@ -25,26 +24,13 @@ jobs:
2524
run: pip install uv
2625

2726
- name: Build codecov-cli sdist and bdist
28-
run: |
29-
cd codecov-cli
30-
uv build
31-
32-
- name: Build prevent-cli sdist and bdist
33-
run: |
34-
cd prevent-cli
35-
uv build
27+
run: uv build
3628

3729
- name: Upload codecov-cli artifacts
3830
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3931
with:
4032
name: codecov-cli_wheel
41-
path: ./codecov-cli/dist/*
42-
43-
- name: Upload prevent-cli artifacts
44-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
45-
with:
46-
name: sentry-prevent-cli_wheel
47-
path: ./prevent-cli/dist/*
33+
path: ./dist/*
4834

4935
build_assets:
5036
name: Build ${{ matrix.os }} binaries
@@ -56,24 +42,16 @@ jobs:
5642
- os: macos-14
5743
TARGET: macos
5844
CMD_BUILD: >
59-
cd ./codecov-cli &&
6045
uv run pyinstaller --target-arch universal2 -F ./codecov_cli/main.py &&
61-
mv ./dist/main ./dist/codecovcli_macos &&
62-
cd ../prevent-cli &&
63-
uv run pyinstaller --target-arch universal2 -F ./src/prevent_cli/main.py &&
64-
mv ./dist/main ./dist/sentry-prevent-cli_macos
46+
mv ./dist/main ./dist/codecovcli_macos
6547
OUT_FILE_SUFFIX: _macos
6648
ASSET_MIME: application/octet-stream
6749

6850
- os: windows-2022
6951
TARGET: windows
7052
CMD_BUILD: >
71-
Set-Location .\codecov-cli &&
7253
uv run pyinstaller -F .\codecov_cli\main.py &&
73-
Move-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe" &&
74-
Set-Location ..\prevent-cli &&
75-
uv run pyinstaller -F .\src\prevent_cli\main.py &&
76-
Move-Item -Path ".\dist\main.exe" -Destination ".\dist\sentry-prevent-cli_windows.exe"
54+
Move-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe"
7755
OUT_FILE_SUFFIX: _windows.exe
7856
ASSET_MIME: application/vnd.microsoft.portable-executable
7957

@@ -88,14 +66,8 @@ jobs:
8866
- name: Install dependencies
8967
run: |
9068
pip install uv
91-
cd prevent-cli
9269
# Need to build pyyaml and ijson from sdists to get universal2 macos build to work
9370
uv sync --no-binary-package pyyaml --no-binary-package ijson
94-
cd ../codecov-cli
95-
uv sync --no-binary-package pyyaml --no-binary-package ijson
96-
97-
- name: Run pre-build script
98-
run: ./scripts/pre-build.sh
9971
10072
- name: Build with pyinstaller for ${{matrix.TARGET}}
10173
run: ${{matrix.CMD_BUILD}}
@@ -104,13 +76,7 @@ jobs:
10476
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
10577
with:
10678
name: codecovcli${{matrix.OUT_FILE_SUFFIX}}
107-
path: ./codecov-cli/dist/codecovcli${{matrix.OUT_FILE_SUFFIX}}
108-
109-
- name: Upload sentry-prevent-cli binary for ${{matrix.TARGET}}
110-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
111-
with:
112-
name: sentry-prevent-cli${{matrix.OUT_FILE_SUFFIX}}
113-
path: ./prevent-cli/dist/sentry-prevent-cli${{matrix.OUT_FILE_SUFFIX}}
79+
path: ./dist/codecovcli${{matrix.OUT_FILE_SUFFIX}}
11480

11581
build_linux_assets:
11682
name: Build ${{ matrix.distro_name }}_${{ matrix.arch }} binary
@@ -152,46 +118,23 @@ jobs:
152118
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
153119
with:
154120
name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
155-
path: ./codecov-cli/dist/codecovcli_*
156-
157-
- name: Upload sentry-prevent-cli binary for ${{matrix.distro_name}}_${{ matrix.arch}}
158-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
159-
with:
160-
name: sentry-prevent-cli_${{ matrix.distro_name }}_${{ matrix.arch }}
161-
path: ./prevent-cli/dist/sentry-prevent-cli_*
121+
path: ./dist/codecovcli_*
162122

163123
package_artifacts:
164124
# Craft requires one artifact named after the long commit sha of the release.
165125
name: Package assets for Craft
166126
runs-on: ubuntu-latest
167127
needs: [build_for_pypi, build_assets, build_linux_assets]
168-
permissions:
169-
id-token: write # needed for signing binaries with OIDC token via Cosign
170128
steps:
171129
- name: Download artifacts
172130
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
173131
with:
174-
pattern: "{sentry-prevent-,codecov-,codecov}cli*"
175-
176-
- name: Install Cosign
177-
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
178-
179-
- name: Sign sentry-prevent-cli binaries
180-
run: |
181-
# Glob matches all prevent-cli binaries, not python wheel nor anything else.
182-
for file in sentry-prevent-cli_*/sentry-prevent-cli_*; do
183-
cosign sign-blob $file --bundle "$file.bundle" --yes;
184-
# Test verification because why not
185-
cosign verify-blob $file --bundle "$file.bundle" --certificate-identity-regexp="^https://github\.com/getsentry/prevent-cli/\.github/workflows/build\.yml@refs/heads/release/[0-9]+\.[0-9]+\.[0-9]+" --certificate-oidc-issuer=https://token.actions.githubusercontent.com
186-
done
132+
pattern: "{codecov-,codecov}cli*"
187133

188134
- name: Upload release artifact
189135
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
190136
with:
191137
name: ${{ github.sha }}
192138
path: |
193-
sentry-prevent-cli*
194-
sentry-prevent-cli_wheel/*
195139
codecovcli*
196140
codecov-cli_wheel/*
197-
*.bundle

.github/workflows/ci.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ jobs:
3737
- name: Install dependencies
3838
run: |
3939
python -m pip install uv
40-
uv sync --project prevent-cli
40+
uv sync
4141
4242
- name: Run command_dump
4343
run: |
4444
make command_dump
4545
4646
- name: Detect changes on commit
4747
run: |
48-
if [ -n "$(git diff codecov-cli/codecovcli_commands prevent-cli/preventcli_commands)" ]; then
48+
if [ -n "$(git diff codecovcli_commands)" ]; then
4949
echo "Please run `make command_dump` before submitting, or install the hooks"
50-
echo "$(git diff codecov-cli/codecovcli_commands prevent-cli/preventcli_commands)"
50+
echo "$(git diff codecovcli_commands)"
5151
exit 1
5252
fi
5353
5454
codecov-startup:
5555
runs-on: ubuntu-latest
56-
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'getsentry' }}
56+
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
5757
steps:
5858
- uses: actions/checkout@v4
5959
with:
@@ -66,15 +66,15 @@ jobs:
6666
- name: Install CLI
6767
run: |
6868
pip install uv
69-
uv sync --project codecov-cli
69+
uv sync
7070
7171
- name: Create commit in codecov
7272
run: |
73-
uv run --project codecov-cli codecovcli -v create-commit -t ${{ secrets.CODECOV_TOKEN }} --git-service github
73+
uv run codecovcli -v create-commit -t ${{ secrets.CODECOV_TOKEN }} --git-service github
7474
7575
- name: Create commit report in codecov
7676
run: |
77-
uv run --project codecov-cli codecovcli -v create-report -t ${{ secrets.CODECOV_TOKEN }} --git-service github
77+
uv run codecovcli -v create-report -t ${{ secrets.CODECOV_TOKEN }} --git-service github
7878
7979
build-test-upload:
8080
strategy:
@@ -96,25 +96,16 @@ jobs:
9696
- name: Install dependencies
9797
run: |
9898
pip install uv
99-
uv sync --project codecov-cli
100-
uv sync --project prevent-cli
99+
uv sync
101100
102101
- name: Test with pytest
103102
run: |
104-
cd codecov-cli
105103
uv run pytest --cov --junitxml=${{matrix.os}}-${{matrix.python-version}}junit.xml
106104
env:
107105
CODECOV_ENV: test
108106

109107
- name: Dogfooding codecov-cli
110-
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'getsentry' }}
108+
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
111109
run: |
112-
uv run --project codecov-cli codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag codecovcli
113-
uv run --project codecov-cli codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag codecovcli
114-
115-
- name: Dogfooding sentry-prevent-cli
116-
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'getsentry' }}
117-
run: |
118-
uv run --project prevent-cli sentry-prevent-cli upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag sentry-prevent-cli
119-
uv run --project prevent-cli sentry-prevent-cli upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag sentry-prevent-cli
120-
uv run --project prevent-cli sentry-prevent-cli upload --report-type test-results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag sentry-prevent-cli
110+
uv run codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag codecovcli
111+
uv run codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag codecovcli

.github/workflows/release-codecov-cli.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
with:
2121
tag: ${{ github.ref_name }}
2222
fileName: codecov_cli-*
23-
out-file-path: codecov-cli/dist
23+
out-file-path: dist
2424

2525
- name: Publish package to PyPi
2626
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
2727
with:
2828
verbose: true
29-
packages-dir: codecov-cli/dist
29+
packages-dir: dist
3030

3131
publish_release:
3232
name: Publish release
File renamed without changes.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ lint:
2424
make lint.run
2525

2626
test:
27-
cd codecov-cli && uv run pytest
27+
uv run pytest
2828

2929
command_dump:
30-
cd prevent-cli && uv run command_dump.py
30+
uv run python command_dump.py
3131

3232
tag.release:
3333
ifeq ($(shell echo ${version} | egrep "${tag_regex}"),)

0 commit comments

Comments
 (0)