🐛 Fix flaky hub validation of synthesized discovery rulesets; run unit tests in CI (#98)#102
Merged
Merged
Conversation
…t tests in CI (#98) * 🐛 Ignore hub-synthesized tag-only discovery rulesets in validation The tackle-hub target synthesizes discovery-rules/technology-usage rulesets from the hub's discovery-task tags, which have no kantra equivalent and are never compared for the hub target. Whether those rulesets survive output filtering depends on whether the discovery tasks finish before koncur snapshots application tags, so tests whose kantra-generated expected output lacks a technology-usage ruleset (e.g. nerd-dinner) fail or pass depending on task timing. Skip the unexpected-ruleset error for tackle-hub when the ruleset is one of the synthesized names and contains nothing but tags. Rulesets carrying real content (violations/insights/errors) still fail, and the missing-ruleset direction is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us> * 🌱 Fix stale unit tests and run them in CI No CI job ran go test, so the unit tests in pkg/config and pkg/targets have been uncompilable since the CustomRule refactor (#44) without anyone noticing. - Update rule-handling tests for the CustomRule model, and rewrite the prepareRules/prepareRulesForHub tests to exercise the real methods (including the hub's one-git-repo and no-mixed-rules error paths) instead of simulating removed logic - Stub the hub login probe in TestNewTackleHubTarget with httptest instead of hitting localhost:8080 (3 minutes of retries) - Add a unit-tests job (go vet + go test) to the PR CI workflow Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us> * 🌱 Restrict unit-tests CI job permissions Scope the job token to contents: read and skip credential persistence on checkout; the job only runs go vet and go test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us> --------- Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Cherry Picker <noreply@github.com>
4 tasks
mguetta1
self-requested a review
July 20, 2026 10:29
mguetta1
enabled auto-merge (squash)
July 21, 2026 05:31
mguetta1
approved these changes
Jul 21, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The tackle-hub target synthesizes discovery-rules/technology-usage
rulesets from the hub's discovery-task tags, which have no kantra
equivalent and are never compared for the hub target. Whether those
rulesets survive output filtering depends on whether the discovery
tasks finish before koncur snapshots application tags, so tests whose
kantra-generated expected output lacks a technology-usage ruleset
(e.g. nerd-dinner) fail or pass depending on task timing.
Skip the unexpected-ruleset error for tackle-hub when the ruleset is
one of the synthesized names and contains nothing but tags. Rulesets
carrying real content (violations/insights/errors) still fail, and the
missing-ruleset direction is unchanged.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Signed-off-by: Fabian von Feilitzsch fabian@fabianism.us
No CI job ran go test, so the unit tests in pkg/config and pkg/targets
have been uncompilable since the CustomRule refactor (#44) without
anyone noticing.
prepareRules/prepareRulesForHub tests to exercise the real methods
(including the hub's one-git-repo and no-mixed-rules error paths)
instead of simulating removed logic
instead of hitting localhost:8080 (3 minutes of retries)
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Signed-off-by: Fabian von Feilitzsch fabian@fabianism.us
Scope the job token to contents: read and skip credential persistence
on checkout; the job only runs go vet and go test.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Signed-off-by: Fabian von Feilitzsch fabian@fabianism.us
Signed-off-by: Fabian von Feilitzsch fabian@fabianism.us
Co-authored-by: Claude Fable 5 noreply@anthropic.com
Signed-off-by: Cherry Picker noreply@github.com