Conversation
… 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.
…pty tag, improving JSON serialization for release metadata.
There was a problem hiding this comment.
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 embeddedChartMetadatastruct 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-motionsupport)
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.
| meta.Digest() | ||
|
|
There was a problem hiding this comment.
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).
| meta.Digest() | |
| meta.Digest() |
| } | ||
| hash := sha256.New() | ||
| for _, field := range fieldsToBeHashed { | ||
| hash.Write([]byte(field)) |
There was a problem hiding this comment.
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.
| hash.Write([]byte(field)) | |
| hash.Write([]byte(field)) | |
| hash.Write([]byte{0}) |
… 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.