Skip to content

workaround(azurelinux-release): simplify spec to address rpmautospec errors#16049

Merged
reubeno merged 1 commit intotomls/base/mainfrom
reubeno/azurelinux-release-fix
Feb 28, 2026
Merged

workaround(azurelinux-release): simplify spec to address rpmautospec errors#16049
reubeno merged 1 commit intotomls/base/mainfrom
reubeno/azurelinux-release-fix

Conversation

@reubeno
Copy link
Member

@reubeno reubeno commented Feb 27, 2026

We're seeing what looks like issues with ternary operators in rpmautospec on koji as well as %autorelease showing up in comments. I can't reproduce it locally but confirmed this update gets things working in koji.

@github-actions
Copy link

github-actions bot commented Feb 27, 2026

Spec Review Failed

Type Count
Errors 3
Warnings 5
Suggestions 4

🛠️ Debug locally: .github/workflows/scripts/README.md

azurelinux-release.spec

❌ Errors (3)
⚠️ Warnings (5)
💡 Suggestions (4)
📄 Raw JSON Report
{
  "spec_reviews": [
    {
      "spec_file": "base/comps/azurelinux-release/azurelinux-release.spec",
      "errors": [
        {
          "description": "License file is installed to \"licenses/LICENSE\" without %{buildroot}; %install must place packaged files under %{buildroot} so %license can include them.",
          "citation": "https://rpm-packaging-guide.github.io/",
          "line": 370
        },
        {
          "description": "Symlink %{_sysconfdir}/swid/swidtags.d/microsoft.com is created but not listed in %files, leaving an unowned file.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/UnownedDirectories/",
          "line": 383
        },
        {
          "description": "identity-wsl has Requires(meta): azurelinux-release-container, which is inconsistent with other identity variants and likely a wrong dependency for the WSL variant.",
          "citation": "N/A",
          "line": 209
        }
      ],
      "warnings": [
        {
          "description": "Summary for identity-wsl ends with a period; Summary should not end with a period.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/#summary-and-description",
          "line": 204
        },
        {
          "description": "Description line exceeds 80 columns; description lines should be <= 80 columns.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/#summary-and-description",
          "line": 102
        },
        {
          "description": "Description uses \"a Azure\" (grammar); summary/description should follow American English grammar.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/#summary-and-description",
          "line": 102
        },
        {
          "description": "Top-level macros use %define instead of %global; guidelines prefer %global except for rare locally-scoped submacros.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/#_global_preferred_over_define",
          "line": 1
        },
        {
          "description": "RELEASE_TYPE is hardcoded to \"development\" while is_development is defined but unused; release-type should reflect the intended release state.",
          "citation": "N/A",
          "line": 279
        }
      ],
      "suggestions": [
        {
          "description": "Consider using %autorelease for the Release tag as recommended by the versioning guidelines.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/",
          "line": 37
        },
        {
          "description": "Consider using %autochangelog instead of a manual changelog.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/#changelogs",
          "line": 449
        },
        {
          "description": "Use %{_datadir} instead of %{_prefix}/share for the DNF5 config install path to align with RPM path macros.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/",
          "line": 386
        },
        {
          "description": "Resolve TODO comments before release (e.g., review markers in the spec).",
          "citation": "N/A",
          "line": 8
        }
      ]
    }
  ]
}

@reubeno reubeno force-pushed the reubeno/azurelinux-release-fix branch from 3664670 to 199b172 Compare February 27, 2026 23:45
@reubeno reubeno force-pushed the reubeno/azurelinux-release-fix branch from 199b172 to c1842e0 Compare February 27, 2026 23:50
@reubeno reubeno marked this pull request as ready for review February 27, 2026 23:57
Copilot AI review requested due to automatic review settings February 27, 2026 23:57
Copy link
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

This PR updates the azurelinux-release RPM spec to avoid Koji/rpmautospec parsing issues by removing %autorelease/%autochangelog usage and simplifying macro logic.

Changes:

  • Replace %autorelease with a fixed Release: 2%{?dist}.
  • Remove RPM %[ ... ? ... : ...] ternary-based release_type macro usage and hard-code RELEASE_TYPE in generated os-release.
  • Replace %autochangelog with a manual %changelog entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +36 to +37
# TODO(azl): Review whether we can move back to autorelease (with conditional -p)
Release: 2%{?dist}
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

Changing Release to a fixed 2%{?dist} breaks the spec’s existing prerelease detection (%if %{starts_with "a%{release}" "a0"}) and makes it impossible to represent the documented 0.<r> development numbering. If development builds still need the 0.* scheme, consider making Release: conditional on %{is_development} (using %if/%else) so prerelease labeling continues to work without relying on %autorelease.

Suggested change
# TODO(azl): Review whether we can move back to autorelease (with conditional -p)
Release: 2%{?dist}
# TODO(azl): Review whether we can move back to autorelease (with conditional -p)
%if %{is_development}
Release: 0.1%{?dist}
%else
Release: 2%{?dist}
%endif

Copilot uses AI. Check for mistakes.
Comment on lines +275 to +279
# TODO(azl): review; dynamically generate RELEASE_TYPE from release_type macro
cat <<EOF >os-release
NAME="%{dist_name}"
VERSION="%{dist_version} (%{release_name}%{?prerelease})"
RELEASE_TYPE=%{release_type}
RELEASE_TYPE=development
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

This block hard-codes RELEASE_TYPE=development and the TODO references a release_type macro that no longer exists (it was removed above). Also, the spec still defines is_development (with comments indicating it will be toggled for RC/stable releases), so stable builds would incorrectly emit development in /etc/os-release. Consider restoring dynamic generation using RPM conditionals (%if 0%{?is_development}%else%endif) instead of the %[ ... ? ... : ...] ternary that Koji/rpmautospec appears to choke on.

Copilot uses AI. Check for mistakes.
@reubeno reubeno merged commit d9c9cf3 into tomls/base/main Feb 28, 2026
9 of 10 checks passed
@reubeno reubeno deleted the reubeno/azurelinux-release-fix branch February 28, 2026 00:00
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