Skip to content

feat: add component-level publish channel configuration#107

Merged
reubeno merged 2 commits intomicrosoft:mainfrom
liunan-ms:liunan/srpm_rpm_publish
Apr 24, 2026
Merged

feat: add component-level publish channel configuration#107
reubeno merged 2 commits intomicrosoft:mainfrom
liunan-ms:liunan/srpm_rpm_publish

Conversation

@liunan-ms
Copy link
Copy Markdown
Contributor

@liunan-ms liunan-ms commented Apr 20, 2026

Add ComponentPublishConfig to ComponentConfig for routing RPM, SRPM, and
debuginfo packages to different publish channels and add backwards-compat support for deprecated 'publish.channel' TOML field.

Key changes:

  • Add ComponentPublishConfig with rpm-channel, srpm-channel, debuginfo-channel fields
  • Add project-level DefaultComponentConfig
  • Update ResolveComponentConfig: distro defaults → project defaults → group
    defaults (sorted) → component explicit config
  • Implement ResolvePackagePublishChannel: selects channel from resolved component
    config, with package-group and per-package overrides
  • Add IsDebugInfoPackage helper using hyphen-delimited segment matching
  • Expose publish channel in azldev package list output
  • Remove support for components..default-package-config (schema + struct field + resolution logic)
  • Add EffectiveRPMChannel() value method: returns RPMChannel if set, falls back to DeprecatedChannel
  • Update docs: project.md (new default-component-config section), components.md,
    component-groups.md, package-groups.md, config-system.md, and how-to guides"

Example output with components-publish.toml:

# Default everything to SDK
[default-component-config.publish]
rpm-channel = "rpm-sdk"
srpm-channel = "rpm-sdk-srpm"
debuginfo-channel = "rpm-sdk-debuginfo"

[component-groups.base-published]
description = "Components whose packages are published to the rpm-base channel"
components = [
    "cmake",
    "jq"
]
[component-groups.base-published.default-component-config.publish]
srpm-channel = "rpm-base-srpm"
rpm-channel = "rpm-base"
debuginfo-channel = "rpm-base-debuginfo"

# Overrides for specific sub-packages that need to go elsewhere
[package-groups.sdk-published]
packages = [
    "cmake-gui"
]

[package-groups.sdk-published.default-package-config.publish]
rpm-channel = "rpms-sdk"
debuginfo-channel = "rpms-sdk-debuginfo"

image image

Copilot AI review requested due to automatic review settings April 20, 2026 07:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds component-level publish channel configuration to azldev so SRPM, RPM, and debuginfo routing can be controlled per component (with project and group defaults), and wires the resolved channels into component build output and package list.

Changes:

  • Introduces ComponentPublishConfig + default-component-config to support project → component-group → component publish defaults.
  • Renames package publish field to rpm-channel and adds debuginfo-channel; updates resolution codepaths to use Resolve*PublishChannel.
  • Adds validation to prevent inheriting publish settings from multiple component groups, and updates schema/docs/snapshots accordingly.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
schemas/azldev.schema.json Updates config schema for new component publish fields and renamed package publish keys.
scenario/snapshots/TestSnapshots_config_generate-schema_stdout_1.snap Snapshot update for schema generation output.
scenario/snapshots/TestSnapshotsContainer_config_generate-schema_stdout_1.snap Snapshot update for schema generation output (container scenario).
internal/projectconfig/project.go Adds DefaultComponentConfig and validates component-group publish ambiguity.
internal/projectconfig/project_test.go Unit tests for component publish group membership validation.
internal/projectconfig/configfile.go Adds default-component-config to config file model.
internal/projectconfig/loader.go Merges default-component-config during config load/merge.
internal/projectconfig/component.go Adds component publish config + resolution helpers for component/SRPM/package publish channels.
internal/projectconfig/package.go Renames package publish channel to RPMChannel and adds DebugInfoChannel; simplifies ResolvePackageConfig.
internal/projectconfig/package_test.go Updates tests for renamed package publish field / changed resolution order.
internal/projectconfig/loader_test.go Updates config loading tests for renamed package publish keys and removed component default package config.
internal/projectconfig/fingerprint_test.go Excludes ComponentConfig.Publish from fingerprinting (routing-only).
internal/app/azldev/cmds/pkg/list.go Uses resolved publish channel helper when listing packages.
internal/app/azldev/cmds/pkg/list_test.go Updates tests to match renamed package publish field.
internal/app/azldev/cmds/component/build.go Adds SRPM publish channel to build results and resolves per-RPM publish channels via new helper.
docs/user/reference/config/project.md Updates examples for renamed package publish key.
docs/user/reference/config/package-groups.md Documents rpm-channel/debuginfo-channel and updates resolution order/examples.
docs/user/reference/config/components.md Removes component default-package-config docs; adds component publish docs/examples.
docs/user/how-to/inspect-package-config.md Updates layer count/resolution description after removing component default package config.

Comment thread internal/projectconfig/component.go Outdated
Comment thread internal/projectconfig/package.go Outdated
Comment thread internal/projectconfig/package.go
Comment thread internal/app/azldev/cmds/component/build.go Outdated
Comment thread docs/user/reference/config/package-groups.md Outdated
Comment thread internal/projectconfig/project.go
Comment thread internal/projectconfig/project.go Outdated
Comment thread internal/app/azldev/cmds/pkg/list.go Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.

Comment thread internal/projectconfig/component.go Outdated
Comment thread internal/projectconfig/project.go
Comment thread internal/app/azldev/cmds/pkg/list.go Outdated
@liunan-ms liunan-ms force-pushed the liunan/srpm_rpm_publish branch from 50f9439 to 295bee8 Compare April 21, 2026 19:01
Copilot AI review requested due to automatic review settings April 23, 2026 21:30
@liunan-ms liunan-ms force-pushed the liunan/srpm_rpm_publish branch from 295bee8 to 07e6484 Compare April 23, 2026 21:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.

Comment thread internal/projectconfig/component.go
Comment thread internal/app/azldev/cmds/pkg/list.go
Comment thread internal/app/azldev/cmds/pkg/list.go
@liunan-ms liunan-ms force-pushed the liunan/srpm_rpm_publish branch from 07e6484 to 445a8d2 Compare April 23, 2026 22:03
Copilot AI review requested due to automatic review settings April 24, 2026 17:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 6 comments.

Comment thread docs/user/reference/config/project.md Outdated
Comment thread docs/user/reference/cli/azldev_package_list.md
Comment thread schemas/azldev.schema.json
Comment thread internal/projectconfig/configfile.go Outdated
Comment thread internal/projectconfig/component.go
Comment thread internal/projectconfig/component.go
Add ComponentPublishConfig to ComponentConfig for routing RPM, SRPM, and
debuginfo packages to different publish channels.

Key changes:
- Add ComponentPublishConfig with rpm-channel, srpm-channel, debuginfo-channel fields
- Add project-level DefaultComponentConfig (lowest-priority config layer)
- Updated ResolveComponentConfig: project defaults → distro defaults → group
  defaults (sorted) → component explicit config
- Implement ResolvePackagePublishChannel: selects channel from resolved component
  config, with package-group and per-package overrides
- Add IsDebugInfoPackage helper using hyphen-delimited segment matching
- Expose publish channel in 'azldev package list' output
- Update docs: project.md (new default-component-config section), components.md,
  component-groups.md, package-groups.md, config-system.md, and how-to guides
@liunan-ms liunan-ms force-pushed the liunan/srpm_rpm_publish branch from 0fdf9f3 to fa9fd09 Compare April 24, 2026 18:28
Comment thread docs/user/reference/config/component-groups.md Outdated
Comment thread internal/projectconfig/component.go
Comment thread internal/projectconfig/component.go
Comment thread internal/projectconfig/configfile.go Outdated
Copilot AI review requested due to automatic review settings April 24, 2026 21:10
@liunan-ms liunan-ms force-pushed the liunan/srpm_rpm_publish branch from fa9fd09 to ec96ded Compare April 24, 2026 21:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.

Comment thread internal/projectconfig/component.go
Comment thread docs/user/how-to/inspect-package-config.md Outdated
Comment thread internal/projectconfig/package.go Outdated
…back

Instead of migrating the deprecated 'publish.channel' TOML field to
'publish.rpm-channel' at load time, preserve the raw value and resolve
it lazily via PackagePublishConfig.EffectiveRPMChannel(). This removes
the migrateDeprecatedFields infrastructure entirely and keeps the
backwards-compat logic close to where it is used.

- Add EffectiveRPMChannel() value method: returns RPMChannel if set,
  falls back to DeprecatedChannel
- Update packagePublishChannel() and synthesizeDebugPackages to call
  EffectiveRPMChannel() instead of reading RPMChannel directly
- Remove migrateDeprecatedFields, migrateDefaultPackagePublishConfig,
  migratePackagePublishConfig functions and their log/slog import
- Remove migrateDeprecatedFields() call from loader.go
- Update four loader tests to assert that DeprecatedChannel is preserved
  as-is and EffectiveRPMChannel() returns the expected value
- Fix DeprecatedChannel jsonschema description (remove stale 'Migrated
  automatically' wording)
- Update docs: resolution order is distro → project → group → component
- Regenerate schema snapshots
@liunan-ms liunan-ms force-pushed the liunan/srpm_rpm_publish branch from ec96ded to ddab0fd Compare April 24, 2026 21:30
@reubeno reubeno merged commit c86e22b into microsoft:main Apr 24, 2026
15 checks passed
@liunan-ms liunan-ms deleted the liunan/srpm_rpm_publish branch April 24, 2026 23:09
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.

3 participants