Skip to content

Address open review comments on PR #15578 (kernel flavor versioning)#16067

Closed
Copilot wants to merge 2 commits into
mbykhovtsev/kernel-macros-filefrom
copilot/address-open-comments-pr-15578
Closed

Address open review comments on PR #15578 (kernel flavor versioning)#16067
Copilot wants to merge 2 commits into
mbykhovtsev/kernel-macros-filefrom
copilot/address-open-comments-pr-15578

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

Addresses all open reviewer comments on PR #15578. Fixes correctness issues in versionsprocessor, refactors CreateChroot to use the functional options pattern, and improves documentation.

Change Log

specreaderutils.CreateChroot — functional options pattern

  • Replaced positional specsDir, srpmsDir, releaseVersionMacrosFile string params with variadic ChrootOption args:
    // Before
    CreateChroot("specparser_chroot", workerTar, buildDir, specsDir, srpmsDir, releaseVersionMacrosFile)
    
    // After
    CreateChroot("specparser_chroot", workerTar, buildDir,
        WithSpecsDir(specsDir),
        WithSRPMsDir(srpmsDir),
        WithReleaseVersionMacrosFile(releaseVersionMacrosFile))

versionsprocessor — correctness & robustness fixes

  • Fixed logger.PanicOnError("string literal") bug (always panicked regardless of error) → Errorf + os.Exit(1)
  • Changed Panicf inside doParse to Errorf; removed silent continue so spec processing errors propagate
  • Added missing error check after chroot.Run(doParse) / doParse()
  • Changed RPM query from %{evr} to %{EPOCHNUM}|%{VERSION}-%{RELEASE} — epoch no longer bleeds into the version macro; azl_<name>_epoch is emitted separately when epoch > 0
  • Macro names now derived from %{NAME} (binary package name) instead of the spec file name
  • processPackageVersionString returns []string (one entry per macro line) instead of a single \n-joined string
  • Package-level var packageVersionRe replaces per-call regexp.MustCompile
  • Removed stale azl3-specific comment on dist tag stripping

versionsprocessor_test.go

  • Updated all tests for new query format (epochnum|version-release) and []string return type
  • Replaced assert.Panics with assert.Error (function now returns error instead of panicking on bad input)
  • Added TestProcessPackageVersionString_NoEpochMacroWhenZero and TestProcessPackageVersionString_UsesPackageNameNotSpecName

toolkit/docs/how_it_works/3_package_building.md

  • Expanded "Dynamic versioning" section; explicitly documents that azl_<name>_release does not include the distro suffix, includes macro format examples
Does this affect the toolchain?

NO

Associated issues
Test Methodology
  • All versionsprocessor unit tests pass (go test ./versionsprocessor/ -v)
  • specreader and versionsprocessor binaries build cleanly

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: PawelWMS <24633722+PawelWMS@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added documentation Improvements or additions to documentation Tools labels Mar 1, 2026
Copilot AI changed the title [WIP] Address all open comments on PR #15578 Address open review comments on PR #15578 (kernel flavor versioning) Mar 1, 2026
@PawelWMS PawelWMS closed this Mar 1, 2026
@PawelWMS PawelWMS deleted the copilot/address-open-comments-pr-15578 branch March 1, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation security Tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants