Skip to content

Commit 8a9a0e5

Browse files
Update CI (#90)
* Bump the github-actions group with 4 updates Bumps the github-actions group with 4 updates: [actions/setup-python](https://github.com/actions/setup-python), [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish), [oxsecurity/megalinter](https://github.com/oxsecurity/megalinter) and [codecov/codecov-action](https://github.com/codecov/codecov-action). Updates `actions/setup-python` from 5.6.0 to 6.0.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@a26af69...e797f83) Updates `pypa/gh-action-pypi-publish` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](pypa/gh-action-pypi-publish@76f52bc...ed0c539) Updates `oxsecurity/megalinter` from 8.8.0 to 9.0.1 - [Release notes](https://github.com/oxsecurity/megalinter/releases) - [Changelog](https://github.com/oxsecurity/megalinter/blob/main/CHANGELOG.md) - [Commits](oxsecurity/megalinter@e08c2b0...0dcbedd) Updates `codecov/codecov-action` from 5.5.0 to 5.5.1 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@fdcc847...5a10915) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: pypa/gh-action-pypi-publish dependency-version: 1.13.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: oxsecurity/megalinter dependency-version: 9.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: codecov/codecov-action dependency-version: 5.5.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> * Update pre-commit * Update megalinter * [MegaLinter] Apply linters fixes * Bump tests --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 7433842 commit 8a9a0e5

File tree

7 files changed

+67
-32
lines changed

7 files changed

+67
-32
lines changed

.github/workflows/addlicense.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
steps:
3333
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
3434

35-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
35+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # 6.0.0
3636
with:
3737
python-version: 3.13
3838
architecture: x64

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
2929

30-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
30+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # 6.0.0
3131
with:
3232
python-version: "3.x"
3333
architecture: x64
@@ -63,7 +63,7 @@ jobs:
6363
path: ./dist/
6464

6565
- name: Upload Package
66-
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # 1.12.4
66+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # 1.13.0
6767

6868
- name: Attest
6969
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # 3.0.0
@@ -79,7 +79,7 @@ jobs:
7979
contents: write
8080
steps:
8181
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
82-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
82+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # 6.0.0
8383
with:
8484
python-version: "3.x"
8585
architecture: x64

.github/workflows/mega-linter.yml

Lines changed: 54 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
# More info at https://megalinter.io
1818
name: MegaLinter
1919

20-
on:
21-
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to main
22-
# push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
20+
on: # yamllint disable-line rule:truthy - false positive
2321
pull_request:
2422

25-
env: # Comment env block if you don't want to apply fixes
26-
# Apply linter fixes configuration
27-
APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
28-
APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
29-
APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)
23+
permissions:
24+
contents: read
25+
26+
env:
27+
APPLY_FIXES: all
28+
APPLY_FIXES_EVENT: pull_request
29+
APPLY_FIXES_MODE: commit
3030

3131
concurrency:
3232
group: ${{ github.ref || github.run_id }}-${{ github.workflow }}
@@ -35,10 +35,10 @@ concurrency:
3535
jobs:
3636
megalinter:
3737
name: MegaLinter
38-
runs-on: ubuntu-latest
38+
runs-on: ubuntu-24.04
3939
permissions:
40-
# Give the default GITHUB_TOKEN write permission to commit and push, comment issues & post new PR
41-
# Remove the ones you do not need
40+
# Give the default GITHUB_TOKEN write permission to commit and push, comment
41+
# issues & post new PR; remove the ones you do not need
4242
contents: write
4343
issues: write
4444
pull-requests: write
@@ -48,19 +48,19 @@ jobs:
4848
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
4949
with:
5050
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
51+
fetch-depth: 0 # Required for pushing commits to PRs
5152

5253
# MegaLinter
5354
- name: MegaLinter
5455
id: ml
55-
# You can override MegaLinter flavor used to have faster performances
56-
# More info at https://megalinter.io/flavors/
57-
uses: oxsecurity/megalinter/flavors/python@e08c2b05e3dbc40af4c23f41172ef1e068a7d651 # 8.8.0
56+
uses: oxsecurity/megalinter/flavors/python@0dcbedd66ea456ba2d54fd350affaa15df8a0da3 # 9.0.1
5857
env:
5958
# All available variables are described in documentation
60-
# https://megalinter.io/configuration/
59+
# https://megalinter.io/latest/configuration/
6160
VALIDATE_ALL_CODEBASE: "true"
6261
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63-
# ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
62+
# ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE
63+
# .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
6464
GITHUB_COMMENT_REPORTER: "true"
6565
PYTHON_RUFF_ARGUMENTS: --config pyproject.toml --config 'output-format="github"'
6666
PYTHON_RUFF_FORMAT_ARGUMENTS: --config pyproject.toml --config 'output-format="github"'
@@ -71,19 +71,53 @@ jobs:
7171
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
7272
with:
7373
name: MegaLinter reports
74+
include-hidden-files: "true"
7475
path: |
7576
megalinter-reports
7677
mega-linter.log
7778
78-
# Push new commit if applicable (for now works only on PR from same repository, not from forks)
79+
# Set APPLY_FIXES_IF var for use in future steps
80+
- name: Set APPLY_FIXES_IF var
81+
run: |
82+
printf 'APPLY_FIXES_IF=%s\n' "${{
83+
steps.ml.outputs.has_updated_sources == 1 &&
84+
(
85+
env.APPLY_FIXES_EVENT == 'all' ||
86+
env.APPLY_FIXES_EVENT == github.event_name
87+
) &&
88+
(
89+
github.event_name == 'push' ||
90+
github.event.pull_request.head.repo.full_name == github.repository
91+
)
92+
}}" >> "${GITHUB_ENV}"
93+
94+
# Set APPLY_FIXES_IF_* vars for use in future steps
95+
- name: Set APPLY_FIXES_IF_* vars
96+
run: |
97+
printf 'APPLY_FIXES_IF_PR=%s\n' "${{
98+
env.APPLY_FIXES_IF == 'true' &&
99+
env.APPLY_FIXES_MODE == 'pull_request'
100+
}}" >> "${GITHUB_ENV}"
101+
printf 'APPLY_FIXES_IF_COMMIT=%s\n' "${{
102+
env.APPLY_FIXES_IF == 'true' &&
103+
env.APPLY_FIXES_MODE == 'commit' &&
104+
(!contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref))
105+
}}" >> "${GITHUB_ENV}"
106+
79107
- name: Prepare commit
80-
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
108+
if: env.APPLY_FIXES_IF_COMMIT == 'true'
81109
run: sudo chown -Rc $UID .git/
110+
82111
- name: Commit and push applied linter fixes
83-
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
84112
uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # 6.0.1
113+
if: env.APPLY_FIXES_IF_COMMIT == 'true'
85114
with:
86-
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
115+
branch: >-
116+
${{
117+
github.event.pull_request.head.ref ||
118+
github.head_ref ||
119+
github.ref
120+
}}
87121
commit_message: "[MegaLinter] Apply linters fixes"
88122
commit_user_name: newrelic-python-agent-team
89123
commit_user_email: [email protected]

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
steps:
3636
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
37-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
37+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # 6.0.0
3838
with:
3939
python-version: "3.10"
4040
architecture: x64
@@ -52,7 +52,7 @@ jobs:
5252
coverage xml
5353
5454
- name: Upload Coverage to Codecov
55-
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # 5.5.0
55+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # 5.5.1
5656
with:
5757
files: coverage.xml
5858
fail_ci_if_error: true
@@ -88,7 +88,7 @@ jobs:
8888
steps:
8989
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
9090

91-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
91+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # 6.0.0
9292
with:
9393
python-version: ${{ matrix.python.version }}
9494
architecture: x64

.megalinter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DEFAULT_BRANCH: main # Usually master or main
2020
SHOW_ELAPSED_TIME: true
2121
FILEIO_REPORTER: false
2222
PRINT_ALPACA: false
23+
FLAVOR_SUGGESTIONS: false
2324
CLEAR_REPORT_FOLDER: true
2425
VALIDATE_ALL_CODEBASE: true
2526
IGNORE_GITIGNORED_FILES: true

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ default_install_hook_types:
2929
repos:
3030
- repo: https://github.com/astral-sh/ruff-pre-commit
3131
# Ruff version.
32-
rev: v0.11.5
32+
rev: v0.13.1
3333
hooks:
3434
# Run the linter.
35-
- id: ruff
36-
args: [--fix]
35+
- id: ruff-check
36+
args: [--fix, --exit-non-zero-on-fix]
3737
stages: [pre-push]
3838
# Run the formatter.
3939
- id: ruff-format
4040
stages: [pre-push]
4141

4242
- repo: https://github.com/google/addlicense
43-
rev: 55a521bf81c24480094950caa3566548fa63875e
43+
rev: v1.2.0
4444
hooks:
4545
- id: addlicense
4646
args:

tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
import zlib
2121

2222
import pytest
23+
from newrelic_telemetry_sdk.version import version
2324
from urllib3 import HTTPConnectionPool, Retry
2425
from urllib3 import HTTPResponse as URLLib3HTTPResponse
2526

2627
from newrelic_telemetry_sdk.client import EventClient, HTTPError, HTTPResponse, LogClient, MetricClient, SpanClient
27-
from newrelic_telemetry_sdk.version import version
2828

2929
SPAN = {
3030
"id": str(uuid.uuid4()),

0 commit comments

Comments
 (0)