Skip to content

Commit e80c8e1

Browse files
authored
Merge branch 'devel' into dependabot/go_modules/go.uber.org/mock-0.6.0
2 parents 28ce632 + 84900f8 commit e80c8e1

File tree

7 files changed

+191
-116
lines changed

7 files changed

+191
-116
lines changed

.github/codecov.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/coverage_reporting.yml

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on: # yamllint disable-line rule:truthy
88

99
env:
1010
DESIRED_GO_VERSION: '1.23'
11+
DESIRED_PYTHON_VERSION: '3.12'
1112

1213
jobs:
1314
go_test_coverage:
@@ -43,31 +44,55 @@ jobs:
4344
- name: Run receptor tests with coverage
4445
run: make coverage
4546

46-
- name: Upload coverage reports to Codecov
47-
uses: codecov/codecov-action@v5
48-
with:
49-
fail_ci_if_error: true
50-
verbose: true
47+
- name: SonarCube Static Scans (on push)
48+
uses: SonarSource/sonarqube-scan-action@v6
49+
if: github.event_name == 'push' && github.repository == 'ansible/receptor'
5150
env:
52-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
51+
SONAR_TOKEN: ${{ secrets[format('{0}', vars.SONAR_TOKEN_SECRET_NAME)] }}
52+
with:
53+
args: >
54+
-Dsonar.go.coverage.reportPaths=coverage.txt
5355
54-
- name: get k8s logs
55-
if: ${{ failure() }}
56-
run: .github/workflows/artifact-k8s-logs.sh
56+
- name: Upload Code Coverage Report from Receptor Unit Tests
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: receptor-coverage-report
60+
path: coverage.txt
5761

58-
- name: remove sockets before archiving logs
59-
if: ${{ failure() }}
60-
run: find /tmp/receptor-testing -name controlsock -delete
62+
- name: Save off PR Number
63+
run: echo "PR ${{ github.event.number }}" > pr_number.txt
6164

62-
- name: Artifact receptor data
63-
uses: actions/upload-artifact@v4.4.3
64-
if: ${{ failure() }}
65+
- name: Upload PR Number
66+
uses: actions/upload-artifact@v4
6567
with:
66-
name: test-logs
67-
path: /tmp/receptor-testing
68+
name: pr_number
69+
path: pr_number.txt
70+
71+
- name: get k8s logs
72+
if: ${{ failure() }}
73+
run: .github/workflows/artifact-k8s-logs.sh
6874

6975
- name: Archive receptor binary
7076
uses: actions/upload-artifact@v4.4.3
7177
with:
7278
name: receptor
7379
path: /usr/local/bin/receptor
80+
81+
- name: Set up nox
82+
uses: wntrblm/nox@2025.05.01
83+
with:
84+
python-versions: ${{ env.DESIRED_PYTHON_VERSION }}
85+
86+
- name: Provision nox environment for coverage
87+
run: nox --install-only --session coverage
88+
working-directory: ./receptorctl
89+
90+
- name: Run `receptorctl` nox coverage session
91+
run: nox --no-install --session coverage
92+
working-directory: ./receptorctl
93+
94+
- name: Upload Code Coverage Report from Receptorctl Unit Tests
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: receptorctl-coverage-report
98+
path: receptorctl/receptorctl_coverage.xml

.github/workflows/pull_request.yml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -168,49 +168,3 @@ jobs:
168168
echo "Output did not contain expected value"
169169
exit 1
170170
fi
171-
172-
receptorctl-test-coverage:
173-
name: Receptorctl test coverage
174-
needs: receptor
175-
runs-on: ubuntu-latest
176-
strategy:
177-
fail-fast: false
178-
matrix:
179-
session:
180-
- coverage
181-
steps:
182-
- name: Download the `receptor` binary
183-
uses: actions/download-artifact@v4
184-
with:
185-
name: receptor-${{ env.DESIRED_GO_VERSION }}
186-
path: /usr/local/bin/
187-
188-
- name: Set executable bit on the `receptor` binary
189-
run: sudo chmod a+x /usr/local/bin/receptor
190-
191-
- name: Set up nox
192-
uses: wntrblm/nox@2025.05.01
193-
with:
194-
python-versions: ${{ env.DESIRED_PYTHON_VERSION }}
195-
196-
- name: Check out the source code from Git
197-
uses: actions/checkout@v4
198-
with:
199-
fetch-depth: 0 # Needed for the automation in Nox to find the last tag
200-
201-
- name: Provision nox environment for ${{ matrix.session }}
202-
run: nox --install-only --session ${{ matrix.session }}
203-
working-directory: ./receptorctl
204-
205-
- name: Run `receptorctl` nox ${{ matrix.session }} session
206-
run: nox --no-install --session ${{ matrix.session }}
207-
working-directory: ./receptorctl
208-
209-
- name: Upload coverage reports to Codecov
210-
uses: codecov/codecov-action@v5
211-
with:
212-
directory: receptorctl
213-
files: receptorctl_coverage.xml
214-
fail_ci_if_error: true
215-
token: ${{ secrets.CODECOV_TOKEN }}
216-
verbose: true

.github/workflows/sonar_checks.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: SonarQube Static Scans (PR)
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Codecov
7+
types:
8+
- completed
9+
10+
permissions: read-all
11+
jobs:
12+
sonarcloud:
13+
name: SonarQube Static Scans (PR)
14+
runs-on: ubuntu-latest
15+
env:
16+
go_version: '1.23'
17+
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
18+
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Fetch receptor coverage report
26+
uses: actions/download-artifact@v4
27+
with:
28+
name: receptor-coverage-report
29+
path: .
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
run-id: ${{ github.event.workflow_run.id }}
32+
33+
- name: Fetch receptorctl coverage report
34+
uses: actions/download-artifact@v4
35+
with:
36+
name: receptorctl-coverage-report
37+
path: .
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
run-id: ${{ github.event.workflow_run.id }}
40+
41+
- name: Fetch PR Number
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: pr_number
45+
path: .
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
run-id: ${{ github.event.workflow_run.id }}
48+
49+
- name: Extract PR Number
50+
run: |
51+
cat pr_number.txt
52+
echo $(head -n1 pr_number.txt | awk '{print $2}')
53+
echo "PR_NUMBER=$(head -n1 pr_number.txt | awk '{print $2}')" >> $GITHUB_ENV
54+
55+
- name: Get Additional PR Information
56+
uses: octokit/request-action@v2.x
57+
id: pr_info
58+
with:
59+
route: GET /repos/{repo}/pulls/{number}
60+
repo: ${{ github.event.repository.full_name }}
61+
number: ${{ env.PR_NUMBER }}
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
65+
- name: Set Additional PR Information
66+
run: |
67+
echo "PR_BASE=${{ fromJson(steps.pr_info.outputs.data).base.ref }}" >> $GITHUB_ENV
68+
echo "PR_HEAD=${{ fromJson(steps.pr_info.outputs.data).head.ref }}" >> $GITHUB_ENV
69+
70+
- name: Checkout Code for PR
71+
run: |
72+
gh pr checkout ${{ env.PR_NUMBER }}
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
76+
- name: SonarQube Scan for receptor
77+
uses: SonarSource/sonarqube-scan-action@v6
78+
env:
79+
SONAR_TOKEN: ${{ secrets[format('{0}', vars.SONAR_TOKEN_SECRET_NAME)] }}
80+
with:
81+
args: >
82+
-Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }}
83+
-Dsonar.pullrequest.key=${{ env.PR_NUMBER }}
84+
-Dsonar.pullrequest.branch=${{ env.PR_HEAD }}
85+
-Dsonar.pullrequest.base=${{ env.PR_BASE }}
86+
87+
- name: SonarQube Scan for receptorctl
88+
uses: SonarSource/sonarqube-scan-action@v6
89+
env:
90+
SONAR_TOKEN: ${{ secrets[format('{0}', vars.SONAR_TOKEN_SECRET_NAME)] }}
91+
with:
92+
projectBaseDir: receptorctl
93+
args: >
94+
-Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }}
95+
-Dsonar.pullrequest.key=${{ env.PR_NUMBER }}
96+
-Dsonar.pullrequest.branch=${{ env.PR_HEAD }}
97+
-Dsonar.pullrequest.base=${{ env.PR_BASE }}

.sonarcloud.properties

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Receptor
22

3-
[![codecov](https://codecov.io/gh/ansible/receptor/branch/devel/graph/badge.svg?token=RAW5Bvh3hM)](https://codecov.io/gh/ansible/receptor)
4-
53
Receptor is an overlay network intended to ease the distribution of work across a large and dispersed collection of workers. Receptor nodes establish peer-to-peer connections with each other via existing networks. Once connected, the Receptor mesh provides datagram (UDP-like) and stream (TCP-like) capabilities to applications, as well as robust unit-of-work handling with resiliency against transient network failures.
64

75
See the readthedocs page for Receptor at:

sonar-project.properties

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SonarQube Cloud project configuration for Receptor
2+
# Complete documentation: https://docs.sonarqube.org/latest/analysis/analysis-parameters/
3+
4+
# =============================================================================
5+
# PROJECT IDENTIFICATION (REQUIRED)
6+
# =============================================================================
7+
8+
# The unique project identifier. This is mandatory.
9+
# Do not duplicate or reuse!
10+
# Available characters: [a-zA-Z0-9_:\.\-]
11+
# Must have least one non-digit.
12+
sonar.projectKey=ansible_receptor
13+
sonar.organization=ansible
14+
15+
# Project metadata
16+
sonar.projectName=receptor
17+
18+
# =============================================================================
19+
# SOURCE AND TEST CONFIGURATION
20+
# =============================================================================
21+
22+
# Source directories to analyze
23+
sonar.sources=.
24+
sonar.exclusions=\
25+
**/*_test.go,\
26+
**/receptorctl/**,\
27+
**/mock_*,\
28+
**/tests/**
29+
30+
# Test directories
31+
sonar.tests=.
32+
sonar.test.inclusions=**/*_test.go
33+
34+
# Set branch-specific new code definition
35+
#
36+
# This is important to always check against the main branch for new PRs,
37+
# otherwise the PR may fail during backporting, since the old version of the code
38+
# may not respect the minimum requirements for the existing Quality Gate.
39+
sonar.newCode.referenceBranch=devel
40+
41+
# =============================================================================
42+
# LANGUAGE CONFIGURATION
43+
# =============================================================================
44+
45+
# File encoding
46+
sonar.sourceEncoding=UTF-8
47+
48+
# =============================================================================
49+
# REPORTS AND COVERAGE
50+
# =============================================================================
51+
52+
sonar.go.coverage.reportPaths=coverage.txt

0 commit comments

Comments
 (0)