-
Notifications
You must be signed in to change notification settings - Fork 11
feat(gnmi-discovery): event-driven gNMI discovery backend #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
leoparente
wants to merge
98
commits into
develop
Choose a base branch
from
feat/gnmi-discovery-backend
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+13,795
−1
Open
Changes from 95 commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
0653f79
feat(gnmi-discovery): initialize go module
leoparente 0363e95
feat(gnmi-discovery): add version, env, logger from snmp-discovery
leoparente 780cbd8
feat(gnmi-discovery): metrics package + nil-safe gNMI accessors
leoparente 1e07864
feat(gnmi-discovery): minimal config types
leoparente a76861f
feat(gnmi-discovery): no-op policy manager and runner
leoparente 1eb0918
feat(gnmi-discovery): http server adapted from snmp-discovery
leoparente 4305b7e
feat(gnmi-discovery): cmd entrypoint on port 8074
leoparente 35f4b88
chore(gnmi-discovery): go mod tidy + fix version.go comments
leoparente 467211e
fix(gnmi-discovery): record request status metric after c.Next()
leoparente 709fdea
feat(gnmi-discovery): full gNMI policy config schema
leoparente a9ffea3
feat(gnmi-discovery): policy validation, defaults, env resolution
leoparente a32dfca
fix(gnmi-discovery): clone slices in MergeDefaults to avoid config al…
leoparente f4f0645
feat(gnmi-discovery): layered OpenConfig profile loader and matcher
leoparente da486a9
feat(gnmi-discovery): gNMI Session interface, Notification type, and …
leoparente 58405cf
feat(gnmi-discovery): gnmic-backed gNMI session implementation
leoparente 511a957
fix(gnmi-discovery): document Close invariant + origin handling, deco…
leoparente d3cedee
feat(gnmi-discovery): in-memory device model with generation pruning
leoparente b32465e
feat(gnmi-discovery): leak-free single-owner debouncer
leoparente c5082d9
feat(gnmi-discovery): path/list-key parsing helpers for translation
leoparente f2d8aa9
feat(gnmi-discovery): per-flush run store and run_id annotation
leoparente 87893ae
test(gnmi-discovery): cover run-id annotation, newest-first runs, sla…
leoparente d398854
feat(gnmi-discovery): event-driven runner with auto-fallback and reco…
leoparente fbc5cb4
test(gnmi-discovery): runner auto-fallback, sync-gate, run-id, resp.E…
leoparente f9ce309
feat(gnmi-discovery): full _base + arista/nokia profiles
leoparente c46e46e
test(gnmi-discovery): dry-run golden test from canned EOS stream
leoparente ec0e93e
feat(gnmi-discovery): dockerfile, makefile, readme
leoparente 8499b2d
fix(gnmi-discovery): stop gnmic subscribe goroutine leak on reconnect…
leoparente 46bdbcd
fix(gnmi-discovery): getStatus race, uint mtu decode, idempotent metr…
leoparente 5ee7dc2
fix(gnmi-discovery): auto-fallback downgrades on async on_change reje…
leoparente fdf4952
fix(gnmi-discovery): reject negative intervals (prevent NewTicker pan…
leoparente 31278f2
ci(gnmi-discovery): add lint and test workflows
leoparente 31bd789
fix(gnmi-discovery): drain buffered early-failure error on notes-clos…
leoparente f06e951
fix(gnmi-discovery): cancel prior subscription on re-Subscribe (auto-…
leoparente 3af418c
fix(gnmi-discovery): redact policy debug log, close Start/Stop wg rac…
leoparente cf4737d
fix(gnmi-discovery): gate first SAMPLE flush on sync_response (avoid …
leoparente 22cd687
fix(gnmi-discovery): trigger flush on SAMPLE sync, teardown prior sub…
leoparente aef5476
fix(gnmi-discovery): reject overflowing interval values (prevent NewT…
leoparente 427ed04
feat(gnmi-discovery): first-class NVIDIA Cumulus profile (vendor alia…
leoparente a186740
feat(gnmi-discovery): capture chassis serial (Device.Serial) and soft…
leoparente 68d4831
feat(gnmi-discovery): attach manufacturer to Platform (parity with sn…
leoparente 0d0cad4
feat(gnmi-discovery): discover manufacturer (chassis mfg-name + capab…
leoparente 0856b37
fix(gnmi-discovery): normalize OpenConfig component-type identityref …
leoparente eb5e960
feat(gnmi-discovery): discover interface type from OpenConfig + user …
leoparente 2d3a4a3
feat(gnmi-discovery): OpenConfig subinterface IP path parser
leoparente 5de6edd
feat(gnmi-discovery): always subscribe+permit the OpenConfig IP subtree
leoparente 81f9dee
feat(gnmi-discovery): translate subinterface IPv4/IPv6 to NetBox IPAd…
leoparente 01582bf
feat(gnmi-discovery): primary IP from target-host match
leoparente 5fb6b24
feat(gnmi-discovery): stamp run_id on IPAddress entities
leoparente 09f4ec5
feat(gnmi-discovery): set device primary IP from the policy target host
leoparente c1773a8
docs(gnmi-discovery): note OpenConfig assumption for always-on IP sub…
leoparente 170589e
chore(gnmi-discovery): bump dependencies to latest + fix lint
leoparente c39a1ba
test(gnmi-discovery): raise unit-test coverage to >=90% per in-scope …
leoparente 8339045
test(gnmi-discovery): cover gnmic transport against in-process gNMI s…
leoparente 459e4e3
test(gnmi-discovery): address review findings on the coverage tests
leoparente 9a55b92
feat(gnmi-discovery): interface type ladder + speed lookup tables
leoparente aaca5eb
feat(gnmi-discovery): subscribe+permit ethernet speed/mac/aggregate-i…
leoparente 45c325c
feat(gnmi-discovery): populate Interface speed/MAC/LAG + ladder-based…
leoparente 3ab0e86
feat(gnmi-discovery): stamp run_id on Interface.Lag references
leoparente 4de5620
refactor(gnmi-discovery): drop ambiguous Juniper et- name rule + guar…
leoparente 6747f32
feat(gnmi-discovery): OpenConfig switched-vlan parser + trunk-vlan ex…
leoparente 31bb51b
feat(gnmi-discovery): always subscribe+permit the OpenConfig switched…
leoparente c9041e4
feat(gnmi-discovery): translate switchport mode + untagged/tagged VLA…
leoparente fe1bd49
feat(gnmi-discovery): stamp run_id on VLAN entities + interface vlan …
leoparente d945eb9
fix(gnmi-discovery): decode native gNMI leaf-list TypedValue
leoparente 1c3ec2f
feat(gnmi-discovery): vlan defaults block (group/tenant/role/tags/des…
leoparente fa5a51b
feat(gnmi-discovery): network-instance VLAN parser + shared VLAN builder
leoparente cf248ca
feat(gnmi-discovery): subscribe+permit the OpenConfig network-instanc…
leoparente 3d08ae0
feat(gnmi-discovery): real VLAN names/status + full VLAN inventory vi…
leoparente a9d01e7
fix(gnmi-discovery): guard VLANGroup.Scope against typed-nil site
leoparente 191fac5
feat(gnmi-discovery): network-instance L3VRF parser + translateVrfs
leoparente ea58237
feat(gnmi-discovery): subscribe+permit network-instance VRF state/mem…
leoparente e4ec426
feat(gnmi-discovery): emit VRFs + bind Interface.Vrf/IPAddress.Vrf (s…
leoparente 7c895c0
feat(gnmi-discovery): stamp run_id on VRF entities + interface/IP vrf…
leoparente ca79e9e
feat(gnmi-discovery): prefix defaults block (role/tenant/tags/descrip…
leoparente ff67b16
feat(gnmi-discovery): derive connected Prefix entities from discovere…
leoparente b3f867b
feat(gnmi-discovery): emit connected prefixes in Translate (after VRF…
leoparente 2fac063
feat(gnmi-discovery): stamp run_id on Prefix entities
leoparente a2cb8d8
feat(gnmi-discovery): discover interface duplex from OpenConfig negot…
leoparente c177928
feat(gnmi-discovery): recognize Dell + SONiC vendors and log selected…
leoparente 0d6accb
feat(gnmi-discovery): Huawei + PortChannel interface-name type patterns
leoparente ac10e88
feat(gnmi-discovery): Cisco/Juniper/Huawei/Dell/SONiC profile overlays
leoparente 3135b2e
refactor(gnmi-discovery): decouple NOS profile selection from manufac…
leoparente e93b412
Merge remote-tracking branch 'origin/develop' into feat/gnmi-discover…
leoparente a3b0a5c
ci(gnmi-discovery): align workflows with modernized per-backend CI
leoparente 336add1
go mod update
leoparente 8da270a
fix(gnmi-discovery): address PR review feedback and bump Go to 1.26.4
leoparente 15f451e
fix(gnmi-discovery): address follow-up PR review
leoparente db19ca7
Merge remote-tracking branch 'origin/develop' into feat/gnmi-discover…
leoparente df82131
fix(gnmi-discovery): address review (413, DELETE race, OTEL env, docs)
leoparente fb90843
Merge remote-tracking branch 'origin/develop' into feat/gnmi-discover…
leoparente 72ac5cc
fix(gnmi-discovery): inherit parent match on override merge; tighten …
leoparente e72e327
ci(gnmi-discovery): build release image without pushing (no DockerHub…
leoparente 7c2cc99
fix(gnmi-discovery): honor skip_verify with TLS material, guard float…
leoparente 9350806
fix(gnmi-discovery): valid branch filters, preserve early-stream erro…
leoparente a3d6fa6
fix(gnmi-discovery): TLS secure by default, explicit insecure opt-in …
leoparente e469f4e
fix(gnmi-discovery): use copied stat for uptime; ensurePort handles z…
leoparente 8f3ba86
fix(gnmi-discovery): reject empty interface_patterns type; README snm…
leoparente 6aab305
fix(gnmi-discovery): apply interface_exclude_patterns to IP/prefix tr…
leoparente File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: gNMI Discovery - lint | ||
| on: | ||
| push: | ||
| branches-ignore: | ||
| - release | ||
| paths: | ||
| - "gnmi-discovery/**" | ||
| - "!gnmi-discovery/docker/**" | ||
| pull_request: | ||
| paths: | ||
| - "gnmi-discovery/**" | ||
| - "!gnmi-discovery/docker/**" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| golangci: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: 'gnmi-discovery/go.mod' | ||
| - name: Lint | ||
| uses: golangci/golangci-lint-action@db582008a42febd596419635a5abc9d9815daa9c # v9.2.1 | ||
| with: | ||
| version: v2.11.3 | ||
| working-directory: gnmi-discovery | ||
| args: --config ../.github/golangci.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,248 @@ | ||
| name: gNMI Discovery - release | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: [ release ] | ||
| paths: | ||
| - "gnmi-discovery/**" | ||
| - "!gnmi-discovery/docker/**" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }} | ||
| cancel-in-progress: false | ||
|
|
||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| SEMANTIC_RELEASE_PACKAGE: ${{ github.repository }} | ||
| APP_NAME: gnmi-discovery | ||
|
|
||
| permissions: | ||
| contents: write | ||
| issues: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| get-next-version: | ||
| name: Semantic release get next version | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: "lts/*" | ||
| - name: Write package.json | ||
| run: | | ||
| cat > "${{ env.APP_NAME }}/package.json" <<'EOF' | ||
| { | ||
| "name": "${{ env.APP_NAME }}", | ||
| "version": "1.0.0", | ||
| "devDependencies": { | ||
| "semantic-release": "^25.0.0-beta.6", | ||
| "semantic-release-export-data": "^1.0.1", | ||
| "semantic-release-monorepo": "^8.0.0", | ||
| "@semantic-release/changelog": "^6.0.3" | ||
| } | ||
| } | ||
| EOF | ||
| - name: Write .releaserc.json | ||
| run: | | ||
| cat > "${{ env.APP_NAME }}/.releaserc.json" <<'EOF' | ||
| { | ||
| "extends": "semantic-release-monorepo", | ||
| "branches": "release", | ||
| "repositoryUrl": "https://github.com/netboxlabs/orb-discovery", | ||
| "debug": "true", | ||
| "tagFormat": "${{ env.APP_NAME }}/v${version}", | ||
| "plugins": [ | ||
| ["semantic-release-export-data"], | ||
| ["@semantic-release/commit-analyzer", { | ||
| "releaseRules": [ | ||
| { "breaking": true, "release": "major" }, | ||
| { "type": "fix", "release": "patch" }, | ||
| { "type": "feat", "release": "minor" }, | ||
| { "type": "perf", "release": "patch" }, | ||
| { "type": "chore", "scope": "deps", "release": "patch" } | ||
| ] | ||
| }], | ||
| "@semantic-release/release-notes-generator", | ||
| [ | ||
| "@semantic-release/changelog", | ||
| { | ||
| "changelogFile": "CHANGELOG.md", | ||
| "changelogTitle": "# Semantic Versioning Changelog" | ||
| } | ||
| ], | ||
| [ | ||
| "@semantic-release/github", | ||
| { | ||
| "assets": [ | ||
| { | ||
| "path": "release/**" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ] | ||
| } | ||
| EOF | ||
| - name: setup semantic-release | ||
| working-directory: ${{ env.APP_NAME }} | ||
| run: npm install --legacy-peer-deps | ||
| - name: release dry-run | ||
| working-directory: ${{ env.APP_NAME }} | ||
| env: | ||
| SLACK_WEBHOOK: ${{ secrets.SLACK_SEMANTIC_RELEASE_WEBHOOK }} | ||
| run: npx semantic-release --debug --dry-run | ||
| id: get-next-version | ||
| - name: Set short sha output | ||
| id: short-sha | ||
| run: echo "short-sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" | ||
| - name: Set release version | ||
| id: release-version | ||
| run: | | ||
| echo "release-version=$(echo '${{ steps.get-next-version.outputs.new-release-version }}' | sed -E 's|^${{ env.APP_NAME }}[-/]||; s|^v||')" >> "$GITHUB_OUTPUT" | ||
| outputs: | ||
| new-release-published: ${{ steps.get-next-version.outputs.new-release-published }} | ||
| new-release-version: ${{ steps.release-version.outputs.release-version }} | ||
| short-sha: ${{ steps.short-sha.outputs.short-sha }} | ||
|
|
||
| confirm-version: | ||
| name: Next version ${{ needs.get-next-version.outputs.new-release-version }} | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| needs: get-next-version | ||
| if: needs.get-next-version.outputs.new-release-published == 'true' | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - run: echo "The new release version is ${{ needs.get-next-version.outputs.new-release-version }} commit ${{ needs.get-next-version.outputs.short-sha }}" | ||
|
|
||
| build: | ||
| name: Build | ||
| needs: get-next-version | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| if: needs.get-next-version.outputs.new-release-published == 'true' | ||
| env: | ||
| BUILD_VERSION: ${{ needs.get-next-version.outputs.new-release-version }} | ||
| BUILD_COMMIT: ${{ needs.get-next-version.outputs.short-sha }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Extract Go version from go.mod | ||
| run: echo "GO_VERSION=$(grep '^go ' gnmi-discovery/go.mod | awk '{print $2}')" >> $GITHUB_ENV | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 | ||
|
|
||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Set build info | ||
| run: | | ||
| echo $BUILD_COMMIT > ./gnmi-discovery/version/BUILD_COMMIT.txt | ||
| echo $BUILD_VERSION > ./gnmi-discovery/version/BUILD_VERSION.txt | ||
|
|
||
| # Build only — gnmi-discovery is experimental and has no DockerHub repo yet, | ||
| # so push is disabled. This still validates the multi-arch image build. | ||
| # Flip push to true (and ensure netboxlabs/gnmi-discovery exists) to publish. | ||
| - name: Build image | ||
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 | ||
| with: | ||
| context: gnmi-discovery | ||
| file: gnmi-discovery/docker/Dockerfile | ||
| platforms: linux/amd64, linux/arm64 | ||
| push: false | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| tags: | | ||
| netboxlabs/gnmi-discovery:latest | ||
| netboxlabs/gnmi-discovery:${{ env.BUILD_VERSION }} | ||
| build-args: | | ||
| GO_VERSION=${{ env.GO_VERSION }} | ||
|
|
||
| semantic-release: | ||
| name: Semantic release | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: "lts/*" | ||
| - name: Write package.json | ||
| run: | | ||
| cat > "${{ env.APP_NAME }}/package.json" <<'EOF' | ||
| { | ||
| "name": "${{ env.APP_NAME }}", | ||
| "version": "1.0.0", | ||
| "devDependencies": { | ||
| "semantic-release": "^25.0.0-beta.6", | ||
| "semantic-release-export-data": "^1.0.1", | ||
| "semantic-release-monorepo": "^8.0.0", | ||
| "@semantic-release/changelog": "^6.0.3" | ||
| } | ||
| } | ||
| EOF | ||
| - name: Write .releaserc.json | ||
| run: | | ||
| cat > "${{ env.APP_NAME }}/.releaserc.json" <<'EOF' | ||
| { | ||
| "extends": "semantic-release-monorepo", | ||
| "branches": "release", | ||
| "repositoryUrl": "https://github.com/netboxlabs/orb-discovery", | ||
| "debug": "true", | ||
| "tagFormat": "${{ env.APP_NAME }}/v${version}", | ||
| "plugins": [ | ||
| ["semantic-release-export-data"], | ||
| ["@semantic-release/commit-analyzer", { | ||
| "releaseRules": [ | ||
| { "breaking": true, "release": "major" }, | ||
| { "type": "fix", "release": "patch" }, | ||
| { "type": "feat", "release": "minor" }, | ||
| { "type": "perf", "release": "patch" }, | ||
| { "type": "chore", "scope": "deps", "release": "patch" } | ||
| ] | ||
| }], | ||
| "@semantic-release/release-notes-generator", | ||
| [ | ||
| "@semantic-release/changelog", | ||
| { | ||
| "changelogFile": "CHANGELOG.md", | ||
| "changelogTitle": "# Semantic Versioning Changelog" | ||
| } | ||
| ], | ||
| [ | ||
| "@semantic-release/github", | ||
| { | ||
| "assets": [ | ||
| { | ||
| "path": "release/**" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ] | ||
| } | ||
| EOF | ||
| - name: setup semantic-release | ||
| working-directory: ${{ env.APP_NAME }} | ||
| run: npm install --legacy-peer-deps | ||
| - name: Release | ||
| working-directory: ${{ env.APP_NAME }} | ||
| env: | ||
| SLACK_WEBHOOK: ${{ secrets.SLACK_OBSERVABILITY_RELEASE_WEBHOOK }} | ||
| run: npx semantic-release --debug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: gNMI Discovery - test | ||
| on: | ||
| push: | ||
| branches-ignore: | ||
| - release | ||
| paths: | ||
| - "gnmi-discovery/**" | ||
| - "!gnmi-discovery/docker/**" | ||
| pull_request: | ||
| paths: | ||
| - "gnmi-discovery/**" | ||
| - "!gnmi-discovery/docker/**" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }} | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| go-test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| defaults: | ||
| run: | ||
| working-directory: gnmi-discovery | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: 'gnmi-discovery/go.mod' | ||
| - name: Run go build | ||
| run: go build ./... | ||
| - name: Install additional dependencies | ||
| run: | | ||
| make install-dev-tools | ||
| - name: Run go test | ||
| id: go-test | ||
| run: | | ||
| make test-coverage | ||
| echo 'coverage-report<<EOF' >> $GITHUB_OUTPUT | ||
| cat .coverage/test-report.md >> $GITHUB_OUTPUT | ||
| echo 'EOF' >> $GITHUB_OUTPUT | ||
| echo "coverage-total=$(cat .coverage/coverage.txt)" >> $GITHUB_OUTPUT | ||
| - name: Output Result | ||
| if: always() | ||
| run: cat .coverage/test-report.md | ||
| - name: Find comment | ||
| # Only on pull_request: on push runs there is no pull_request.number, and | ||
| # find-comment v4 coerces the empty input to 0 and fails the job. | ||
| if: github.event_name == 'pull_request' | ||
| uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0 | ||
| id: existing-comment | ||
| with: | ||
| issue-number: ${{ github.event.pull_request.number }} | ||
| comment-author: 'github-actions[bot]' | ||
| body-includes: Go test coverage | ||
| - name: Post comment | ||
| uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 | ||
| if: github.event.pull_request.head.repo.full_name == github.repository | ||
| with: | ||
| comment-id: ${{ steps.existing-comment.outputs.comment-id }} | ||
| issue-number: ${{ github.event.pull_request.number }} | ||
| body: | | ||
| Go test coverage | ||
| ${{ steps.go-test.outputs.coverage-report }} | ||
| Total coverage: ${{ steps.go-test.outputs.coverage-total }}% | ||
| edit-mode: replace | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.