Skip to content
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: support asset type and filepath #242

Merged
merged 4 commits into from
Jun 17, 2021
Merged

Conversation

yxonic
Copy link
Contributor

@yxonic yxonic commented Jun 1, 2021

Implemented two options for assets according to GitLab document on asset permanent link and link type, addressing #161.

It can also be a solution to #167, with which now we can download asset using URL like this: https://host/namespace/project/releases/v1.0.0/downloads/build.tar.gz

Copy link
Contributor

@nfriend nfriend left a comment

Choose a reason for hiding this comment

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

@yxonic This looks great! Thanks for putting this PR together.

I have one small suggestion on the current changes. I also think we should cover this new field in a test, most likely in publish.test.js.

Back to you for now 🏓 Feel free to ping me when this is ready for another review!

lib/publish.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@yxonic
Copy link
Contributor Author

yxonic commented Jun 5, 2021

@nfriend thanks for your time reviewing the code! I've made several changes according to your suggestions:

  1. I agree with your comments, so link_type is now undefined as default, which also fixes tests.
  2. Added a testcase to cover these fields. I'm not exactly sure if I did it right, so if there's any problem, just let me know :)

Copy link
Contributor

@nfriend nfriend left a comment

Choose a reason for hiding this comment

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

@yxonic Looking great! Thanks for the changes and for adding the test.

I did find one usability issue that I think we should address, which I've mentioned below.

Also, I think we should log the type and filepath when in debug mode on lines 54-55 in publish.js (for some reason GitHub doesn't let me comment on the lines directly - I guess I'm just too used to GitLab 😅).

Let me know what you think. And please let me know if you need help with any of the suggested changes. I realize I'm probably requesting more changes than you originally bargained for 😄

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
lib/publish.js Show resolved Hide resolved
@yxonic yxonic requested a review from nfriend June 11, 2021 15:11
@yxonic
Copy link
Contributor Author

yxonic commented Jun 11, 2021

@nfriend Hi~ I just fixed the links. Regarding the duplicate filepath issue, I took a slightly different approach here. I noticed that label is basically ignored when there are more than one files, and I think we can do the same for filepath for consistency: filepath will still work when there is only one file matched (user can still use *), and won't break the pipeline if more than one file is matched later. This behavior is also documented and tested.

@nfriend
Copy link
Contributor

nfriend commented Jun 16, 2021

@yxonic Sorry for the slow response here, I'm going to try and get to this tomorrow!

@nfriend
Copy link
Contributor

nfriend commented Jun 17, 2021

Regarding the duplicate filepath issue, I took a slightly different approach here.

@yxonic Good call! This is a simpler and more consistent solution 👍 And thanks for documenting this behavior.

Copy link
Contributor

@nfriend nfriend left a comment

Choose a reason for hiding this comment

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

@yxonic This looks good to me! Just gave this a try in a test project and it works great. Thanks for all your work here!

@nfriend nfriend merged commit 77dc201 into semantic-release:master Jun 17, 2021
@github-actions
Copy link

🎉 This PR is included in version 6.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants