8000 Refactor metadata handling in release and templating systems. Updated… by GareArc · Pull Request #5 · composepack/composepack · GitHub
[go: up one dir, main page]

Skip to content

Refactor metadata handling in release and templating systems. Updated…#5

Merged
GareArc merged 3 commits intomainfrom
dev
Nov 19, 2025
Merged

Refactor metadata handling in release and templating systems. Updated…#5
GareArc merged 3 commits intomainfrom
dev

Conversation

@GareArc
Copy link
Collaborator
@GareArc GareArc commented Nov 19, 2025

… Metadata struct to include ChartMetadata and added a digest function for integrity checks. Simplified chart information access in the application layer. Enhanced SVG assets with animations for improved visual appeal and accessibility. Updated README to reflect changes in functionality and clarify usage.

… Metadata struct to include ChartMetadata and added a digest function for integrity checks. Simplified chart information access in the application layer. Enhanced SVG assets with animations for improved visual appeal and accessibility. Updated README to reflect changes in functionality and clarify usage.
Copilot AI review requested due to automatic review settings November 19, 2025 00:50
…pty tag, improving JSON serialization for release metadata.
Copy link
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 refactors the metadata handling system by consolidating chart information into a single ChartMetadata struct and introducing a digest function for integrity verification. It simplifies the chart information access pattern in the application layer and enhances SVG assets with animations while improving visual accessibility.

Key Changes:

  • Replaced separate chart fields (ChartName, ChartVersion) with embedded ChartMetadata struct for cleaner code organization
  • Added a Digest() method for computing integrity hashes of release metadata
  • Enhanced SVG assets with CSS animations and accessibility features (prefers-reduced-motion support)

Reviewed Changes

Copilot reviewed 4 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/core/templating/engine.go Replaced custom ChartInfo struct with chart.ChartMetadata for consistent chart representation
internal/core/release/metadata.go Refactored to use embedded ChartMetadata; added Digest() method and logic to hide confidential values from persisted metadata
internal/app/app.go Simplified chart information passing by directly using ch.Metadata instead of mapping to intermediate struct
docs/images/icon.svg Added stacked animation for bars with accessibility support
docs/images/flow.svg Added flowing arrow animation for visual appeal
docs/images/banner.svg Added comprehensive animations for icon and flow diagram with sequential timing
docs/images/banner-simple.svg Added stacked bar animation with accessibility support
README.md Updated formatting from hyphens to asterisks for list items, improved clarity and consistency

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

Comment on lines +79 to 80
meta.Digest()

Copy link
Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The Digest() method is called before CreatedAt is set at line 77. This means the digest will be calculated with a zero timestamp when meta.CreatedAt.IsZero() is true, and then CreatedAt is updated afterward. This could lead to inconsistent digest values. Move meta.Digest() to after the CreatedAt initialization (line 80, after the closing brace on line 78).

Suggested change
meta.Digest()
meta.Digest()

Copilot uses AI. Check for mistakes.
}
hash := sha256.New()
for _, field := range fieldsToBeHashed {
hash.Write([]byte(field))
Copy link
Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Concatenating strings without delimiters when hashing can lead to hash collisions. For example, hashing ["a", "bc"] would produce the same hash as ["ab", "c"]. Add a separator or null byte between fields: hash.Write([]byte(field + "\x00")) or use a more structured approach like hashing field length before each field.

Suggested change
hash.Write([]byte(field))
hash.Write([]byte(field))
hash.Write([]byte{0})

Copilot uses AI. Check for mistakes.
@GareArc GareArc merged commit d39bf8c into main Nov 19, 2025
1 check passed
@GareArc GareArc deleted the dev branch November 19, 2025 00:57
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.

2 participants

0