-
Notifications
You must be signed in to change notification settings - Fork 4
fix(static): fixed embed fs checking #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's Guide by SourceryThis pull request fixes an issue with embed file system checking and updates the etag generation to use md5 instead of sha512. Sequence diagram for updated file viewer etag generationsequenceDiagram
participant FV as FileViewer
participant FS as FileSystem
participant Hash as Hash Function
FV->>FS: Open file
activate FS
FS-->>FV: Return file handle
deactivate FS
Note over FV,Hash: Changed from sha512 to md5
FV->>Hash: Create MD5 hash
activate Hash
Hash-->>FV: Return hash
deactivate Hash
FV->>FV: Format etag with hex encoding
Class diagram showing StaticViewEngine and FileViewer changesclassDiagram
class StaticViewEngine {
-bool isEmbedFsys
+Load(fsys fs.FS, app *App) error
}
class FileViewer {
-string etag
-bool isEmbed
+NewFileViewer(fsys fs.FS, path string, isEmbed bool) *FileViewer
}
note for StaticViewEngine "Changed embed FS detection"
note for FileViewer "Changed hash from sha512 to md5"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @cnlangzi - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a comment explaining why MD5 is used for etag generation (e.g., performance vs cryptographic security tradeoff)
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
==========================================
+ Coverage 90.97% 90.99% +0.02%
==========================================
Files 37 37
Lines 1330 1333 +3
==========================================
+ Hits 1210 1213 +3
Misses 83 83
Partials 37 37
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Here's the code health analysis summary for commits Analysis Summary
|
Changed
Fixed
Added
Tests
Tasks to complete before merging PR:
make unit-test
to check for any regressions 📋make lint
to check for any issuesSummary by Sourcery
Fix embed filesystem checking and use MD5 for ETag generation.
Bug Fixes:
Enhancements: