fix(rpm-repos): address PR review feedback and lint failures#1
Merged
reubeno merged 2 commits intoMay 5, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/reubeno/azure-linux-dev-tools/sessions/d4c98325-0858-499b-ab64-64af252b4f73 Co-authored-by: reubeno <10508433+reubeno@users.noreply.github.com>
Agent-Logs-Url: https://github.com/reubeno/azure-linux-dev-tools/sessions/d4c98325-0858-499b-ab64-64af252b4f73 Co-authored-by: reubeno <10508433+reubeno@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
reubeno
May 5, 2026 21:45
View session
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.
Resolves Copilot review feedback on PR microsoft#156 and the failing
LintandScenario testschecks (the latter caused by an out-of-date checked-in JSON schema snapshot).Behavior changes
validateRemoteURI: rejects opaque URIs (e.g.https:example.com) and requires a non-emptyHost.validateGPGKey: same opaque rejection;http(s)requiresHost,file://requires emptyHost+ absolutePath(i.e. realfile:///abs/pathform).addConfiguredImageBuildRepos: no-op (info log) wheninputs.image-buildis unconfigured, instead of hard-failing. The.kiwidescription and--repoflags continue to supply repos for those projects. The "all entries filtered out byarches" path is unchanged.Schema
RpmRepoResource.JSONSchemaExtendnow mirrors the runtime constraints:oneOf(base-uri, metalink)and a tightenedgpg-keypattern (^((https?|file)://\S+|[^\s:]\S*)$).gpg-keydescription struct tag — without this, the jsonschema reflector truncates the description at the first comma, which is why the previous schema only listedhttp.schemas/azldev.schema.json(this is what was makingTestCheckedInSchemasAreUpToDatefail).Lint
prepare_test.goandresources_test.goto*_internal_test.go(they exercise unexported symbols; the suffix is the repo's existing escape hatch fromtestpackage).//nolint:recvcheckonResourcesConfigandRpmRepoResource—JSONSchemaExtendmust be a value receiver becauseinvopop/jsonschemaonly invokes value-receiver methods viat.Implements.validateRpmRepointovalidateRpmRepoSource/validateRpmRepoGPGto drop cyclomatic complexity below 15 and remove the single-case switch.siteDefaultsPerm = 0o644andschemeHTTP/HTTPS/Fileconstants; renamed short variables; applied staticcheck QF1001/QF1002; reworded ST1005 errors;assert.Emptyoverassert.Equal(t, "", …).Tests
TestValidateRpmRepocases for the new URI shape rules: opaque base-uri/metalink/gpg-key, missing host onhttps:///path, andfile://server/share/....