diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84e73c0f21..ad18addd0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,3 +85,37 @@ jobs: push_rolling: true repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-api' }} cache_file: "uv.lock" + + upload-overwatch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Static Analysis Tools + run: | + pip install mypy==1.15.0 + pip install ruff==0.3.3 + - name: Install Build Dependencies + run: | + sudo apt-get update + # Install libssl1.1 from Ubuntu 20.04 repositories + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb + sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb + - name: Install Overwatch CLI + run: | + curl -o overwatch-cli https://overwatch.codecov.dev/linux/cli + chmod +x overwatch-cli + - name: Print Current Working Directory + run: pwd + - name: List Contents of Current Working Directory + run: ls -la + - name: List Directories Under Root + run: ls -d /*/ + - name: Run Overwatch CLI + run: | + ./overwatch-cli \ + --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} \ + --organization-slug codecov \ + python \ + --python-path $(which python3) + + \ No newline at end of file diff --git a/.github/workflows/upload-overwatch.yml b/.github/workflows/upload-overwatch.yml new file mode 100644 index 0000000000..daf6b3a8a8 --- /dev/null +++ b/.github/workflows/upload-overwatch.yml @@ -0,0 +1,48 @@ +# Created on 2025-03-20 14:30:36 +name: Upload Overwatch - 2025-03-20 14:30:36 + +on: + pull_request: + types: + - opened + - synchronize + push: + branches-ignore: + - main + +jobs: + upload-overwatch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.13' + - name: Install UV + run: pip install uv + - name: Install Project Dependencies + run: | + uv export --format requirements-txt > requirements.txt + uv pip install -r requirements.txt --system + - name: Install Static Analysis Tools + run: | + pip install mypy==1.15.0 + pip install ruff==0.9.6 + - name: Install Build Dependencies + run: | + sudo apt-get update + # Install libssl1.1 from Ubuntu 20.04 repositories + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb + sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb + - name: Install Overwatch CLI + run: | + curl -o overwatch-cli https://overwatch.codecov.dev/linux/cli + chmod +x overwatch-cli + - name: Run Overwatch CLI + run: | + ./overwatch-cli \ + --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} \ + --organization-slug codecov \ + --pullid 1196 \ + python \ + --python-path $(which python3) diff --git a/Makefile b/Makefile index 499d520efe..bea54b57ab 100644 --- a/Makefile +++ b/Makefile @@ -63,14 +63,11 @@ lint.install.local: uv add --dev ruff lint.run: - ruff check ruff format lint.check: echo "Linting..." - ruff check echo "Formatting..." - ruff format --check build.requirements: # if docker pull succeeds, we have already build this version of diff --git a/services/components.py b/services/components.py index 318e22e01b..190dee1237 100644 --- a/services/components.py +++ b/services/components.py @@ -31,6 +31,14 @@ def component_filtered_report( """ Filter a report such that the totals, etc. are only pertaining to the given component. """ + print(report) + print(components) + + # This will fail mypy with "Item "None" of "Optional[Report]" has no attribute "filter"" + # Because we're not checking if report is None before accessing filter() + report: Optional[Report] = report + filtered_report = report.filter(flags=flags, paths=paths) + flags, paths = [], [] for component in components: flags.extend(component.get_matching_flags(report.flags.keys()))