Skip to content

ignore webhook events for repos outside SYNC_REPOS_LIST - #492

Open
oldgiova wants to merge 3 commits into
mendersoftware:masterfrom
oldgiova:QA-1742-misplaced-comments
Open

ignore webhook events for repos outside SYNC_REPOS_LIST#492
oldgiova wants to merge 3 commits into
mendersoftware:masterfrom
oldgiova:QA-1742-misplaced-comments

Conversation

@oldgiova

@oldgiova oldgiova commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This to ignore noisy errors like
image

for repositories outside Gitlab CICD

Co-authored-with: Claude

Ticket: QA-1742

Companion PR:

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.44444% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
main.go 82.60% 3 Missing and 1 partial ⚠️
main_push.go 25.00% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@oldgiova

Copy link
Copy Markdown
Contributor Author

@olehermanse FYI

@oldgiova
oldgiova force-pushed the QA-1742-misplaced-comments branch from b7c5387 to 88835f8 Compare August 31, 2026 16:00
strings.Split("", ",") returns a one-element slice containing the empty string,
so SYNC_REPOS_LIST="" did not mean "all repositories", it meant a list matching
nothing, which silently disabled all syncing. The ConfigMaps already use "" as
the leave-at-default convention for two other keys.

Trim entries and drop empty ones, and add isRepoInSyncList as the single place
that decides whether this deployment acts on a repository. An empty list still
means all repositories, which the mendersoftware deployment relies on. Nothing
calls the predicate yet; wiring it into the webhook handlers is the next commit.

Ticket: QA-1742

Signed-off-by: Roberto Giovanardi <roberto.giovanardi@northern.tech>
SYNC_REPOS_LIST was only consulted on push events, so the CFEngine and
NorthernTechHQ deployments ran the full pull request path on every repository in
their organizations. On an opted-out repo the bot force-pushed a pr_N branch to
GitLab, tried to start a pipeline, and commented "There was an error running
your pipeline" on an unrelated review. On PR close it also deleted a GitLab
branch and removed its protection.

Gate every event type in processGitHubWebhook, which also collapses the
duplicate check in processGitHubPush. The gate runs before conf.githubOrganization
is set, so an ignored event does not mutate shared state. An empty list still
means all repositories, so the mendersoftware deployment is unaffected.

Ticket: QA-1742

Signed-off-by: Roberto Giovanardi <roberto.giovanardi@northern.tech>
The acceptance harness never set SYNC_REPOS_LIST, so the opt-in path had no
coverage and the gate could regress silently. Configure the runner the way the
CFEngine and NorthernTechHQ deployments are, listing every repository the
existing payloads use, and add push and pull request payloads for a repository
outside that list.

Both new tests assert a single ignore line and no side effects. The existing
tests are the positive control: they all run against listed repositories and
their golden files are unchanged.

Ticket: QA-1742

Signed-off-by: Roberto Giovanardi <roberto.giovanardi@northern.tech>
@oldgiova
oldgiova force-pushed the QA-1742-misplaced-comments branch from 88835f8 to f0259ca Compare August 31, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant