-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
feat(publisher-github): assets management #1761
Conversation
It would be awesome to remove deprecation warning by merging this PR: #1673 But there are broken tests. |
@malept is it possible to have it merged? |
@malept What should I do to have this PR merged? |
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.
I'd prefer if there were some tests around name sanitization.
Also the PR title needs to be fixed to be conventional commits-formatted
Codecov Report
@@ Coverage Diff @@
## master #1761 +/- ##
===========================================
+ Coverage 60.28% 72.73% +12.45%
===========================================
Files 71 74 +3
Lines 2153 2223 +70
Branches 411 420 +9
===========================================
+ Hits 1298 1617 +319
+ Misses 676 446 -230
+ Partials 179 160 -19
Continue to review full report at Codecov.
|
@malept any chance to have this PR merged? |
@malept ping again |
Just rebased this with latest |
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.
I don't think this is shippable with the current GitHub.sanitizeName
implementation. I tried looking for updated documentation and found this paragraph in their docs on uploading release assets:
GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "List assets for a release" endpoint lists the renamed filenames. For more information and help, contact GitHub Support.
I couldn't find any additional details on the replacement actual algorithm used, but it doesn't seem to match the sanitizeName
regex replacements based on my tests uploading release assets through the GitHub UI.
Raw filename | sanitizeName | GitHub UI |
---|---|---|
erick@256éoooz!.txt | erick-256e-oooz-.txt | [email protected] |
fake. file.txt | fake.file.txt | fake.file.txt |
erick%%%%%!!!zhao.txt | erick--------zhao.txt | erick.zhao.txt |
The weird thing is that @
is not alphanumeric but does not get sanitized by GitHub. The opaqueness of their algorithm makes it hard to write exact and accurate replacement code.
Proposal
Instead of trying to dealing with the black box sanitization algorithm, do we want to force delete all assets upon --force
before republishing?
@erickzhao deleting all assets is not suitable for me because assets uploaded per platform, so multiple publishers will remove assets of each other. |
@erickzhao I think it is ok to ship |
@erickzhao could we have it merged? Should I rebase PR? |
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.
I think this is still a net improvement over the previous implementation.
Could it be merged? |
@erickzhao @malept I've rebased on top of current main branch. Could the PR be merged or should I change something? |
Summarize your changes:
This PR includes fixes related to
publisher-gihub
: