Skip to content

Fix: trim RPM package names in DOT file visualization#380

Merged
arodage merged 4 commits intomainfrom
feature/trim-rpm-package-names-in-dot
Feb 6, 2026
Merged

Fix: trim RPM package names in DOT file visualization#380
arodage merged 4 commits intomainfrom
feature/trim-rpm-package-names-in-dot

Conversation

@arodage
Copy link
Copy Markdown
Contributor

@arodage arodage commented Feb 5, 2026

Merge Checklist

All boxes should be checked before merging the PR

  • The changes in the PR have been built and tested
  • Ready to merge

Description

This PR improves the DOT file visualization for RPM package dependencies by trimming the version and architecture suffixes from package names, making dependency graphs more readable.

Changes:

  • Modified internal/ospackage/rpmutils/resolver.go to trim .x86_64, .noarch, .aarch64 and version strings from RPM package names in the DOT file output
  • Package names in the dependency graph are now cleaner (e.g., kernel instead of kernel-6.6.35.1-5.azl3.x86_64)

Impact:

  • Documentation: DOT files are more readable for understanding package dependencies
  • Backwards Compatibility: No breaking changes, only affects DOT file output format
  • Performance: Minimal overhead (simple string trimming)

Any Newly Introduced Dependencies

No new dependencies introduced.

How Has This Been Tested?

  • Tested with Azure Linux 3 package dependency resolution
  • Generated DOT files with earthly +build and verified cleaner package names
  • Ran earthly +test-quick - all existing tests pass
  • Manually inspected generated DOT file output to confirm package name trimming works correctly

sudo ./build/os-image-composer build image-templates/azl3-x86_64-minimal-raw.yml --dotfile azl3_raw.dot

./scripts/dep-analyzer.sh -i azl3_raw.dot -r cloud-init -d 1 -t svg Rendered: azl3_raw_cloud-init_d1.svg

Copilot AI review requested due to automatic review settings February 5, 2026 01:56
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

This PR enhances RPM package visualization in DOT files by trimming package names to their base form, making them consistent with Debian package visualization.

Changes:

  • Extract base package names from full RPM filenames (e.g., 'libgcrypt' from 'libgcrypt-1.10.3-1.azl3.x86_64.rpm')
  • Apply name trimming to both node identifiers and labels in the DOT graph
  • Apply the same trimming to dependency edges for consistency

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

Comment thread internal/ospackage/rpmutils/resolver.go Outdated
@arodage arodage force-pushed the feature/trim-rpm-package-names-in-dot branch from bf0751d to 953f7fb Compare February 5, 2026 02:20
@arodage arodage changed the title feat(ospackage): trim RPM package names in DOT file visualization Fix: trim RPM package names in DOT file visualization Feb 5, 2026
Comment thread internal/ospackage/rpmutils/resolver.go
- Extract base package names (e.g., 'libgcrypt' instead of 'libgcrypt-1.10.3-1.azl3.x86_64.rpm')
- Apply extractBasePackageNameFromFile() to both node IDs and labels
- Apply same trimming to dependency edges for consistency
- Makes RPM dot files consistent with Debian packages for cleaner visualization
- Dot file is visualization-only, does not affect build logic or package resolution
- Dependencies in pkg.Requires can be capability strings (e.g., 'libc.so.6(GLIBC_2.2.5)')
- extractBaseRequirement() properly handles both capabilities and package requirements
- Addresses Copilot review feedback
- Apply extractBasePackageNameFromFile() after extractBaseRequirement()
- Ensures both capability strings and package filenames are trimmed
- Dependencies now show clean names (e.g., 'filesystem' instead of 'filesystem-1.1-21.azl3.x86_64.rpm')
- Strip ALL parenthesized suffixes, not just ()(64bit)
- Handles complex capability strings like libc.so.6(GLIBC_2.38)(64bit)
- Fixes shadow-utils and openssh-server dependency visualization
- Added documentation with examples
- Added comment about duplicate node declarations
@arodage arodage force-pushed the feature/trim-rpm-package-names-in-dot branch from dd96769 to 7580d87 Compare February 5, 2026 18:17
Copy link
Copy Markdown
Contributor

@magerstam magerstam left a comment

Choose a reason for hiding this comment

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

Overall looks good. Let's make sure we think through whether we could have scenarios where pkgA version N --> N+1 could introduce new/additional differences

@arodage arodage merged commit 02a75b5 into main Feb 6, 2026
22 checks passed
arodage added a commit that referenced this pull request Feb 10, 2026
…age-names-in-dot

Fix: trim RPM package names in DOT file visualization
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