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: pipe for Sonatype Nexus Raw repositories #1204

Closed
wants to merge 8 commits into from

Conversation

antonienko
Copy link
Contributor

Enables Goreleaser to upload artifacts to Sonatype Nexus Raw repositories.

@antonienko
Copy link
Contributor Author

I needed this feature for my own selfish goals, and I figured I could contribute it to the project. Since it's my first contribution, I'm open to receive feedback and suggestions on how to improve this pull request.

internal/pipe/nexus_raw/nexus_raw.go Outdated Show resolved Hide resolved
pkg/config/config.go Outdated Show resolved Hide resolved
pkg/config/config.go Show resolved Hide resolved
internal/pipe/nexus_raw/nexus_raw.go Outdated Show resolved Hide resolved
internal/pipe/nexus_raw/nexus_raw.go Outdated Show resolved Hide resolved
@caarlos0
Copy link
Member

Just a couple of comments. :)

Also would be nice if you could add the docs as well 🚀

Thanks for the PR 👏

@antonienko
Copy link
Contributor Author

I have added some basic documentation based on the artifactory one.

Since the functionality of this pipe is so simple, I haven't go into details of the different configuration parameters. Let me know if you need anything else at this stage, or we can evolve the documents at the same time that this pipe grows.

@codecov-io
Copy link

codecov-io commented Oct 23, 2019

Codecov Report

Merging #1204 into master will decrease coverage by 0.76%.
The diff coverage is 54.02%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1204      +/-   ##
==========================================
- Coverage   83.65%   82.88%   -0.77%     
==========================================
  Files          58       59       +1     
  Lines        3285     3372      +87     
==========================================
+ Hits         2748     2795      +47     
- Misses        456      478      +22     
- Partials       81       99      +18
Impacted Files Coverage Δ
pkg/config/config.go 100% <ø> (ø) ⬆️
internal/pipe/publish/publish.go 84.61% <ø> (ø) ⬆️
internal/pipe/nexusraw/nexusraw.go 54.02% <54.02%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5102c8a...cbcc9dc. Read the comment docs.

@antonienko
Copy link
Contributor Author

@caarlos0 Is there anything else I need to do for the pull request to be reviewed?

@caarlos0
Copy link
Member

@caarlos0 Is there anything else I need to do for the pull request to be reviewed?

no, I just haven't make the time to look into it yet... sorry for the delay :(

internal/pipe/nexusraw/nexusraw.go Show resolved Hide resolved
internal/pipe/nexusraw/nexusraw.go Show resolved Hide resolved
internal/pipe/nexusraw/nexusraw_test.go Show resolved Hide resolved
repository: example-repo
directory: example-folder
username: your-username
password: your-password
Copy link
Member

Choose a reason for hiding this comment

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

we should probably get the password from an environment variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In order to do this, shoud I use the EnvFiles struct in the config/config.go file together with the loadEnv function?

Seems like it is very tailor-made to the git release process.

Should I load the env variable in my pipe instead?

Copy link
Member

@caarlos0 caarlos0 Oct 29, 2019

Choose a reason for hiding this comment

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

take a look on the artifactory pipe, it uses the internal http package, which thinking now, maybe we can try to use here as well, which should handle secrets and etc

https://goreleaser.com/artifactory/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem I see with it is that the internal http package has a hardcoded PUT method, so in order to use it I would need to refactor it to be able to use POST, which is the verb that Nexus accepts for uploads.

Copy link
Member

Choose a reason for hiding this comment

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

I think we can refactor that first then? Maybe in another PR even?

Basically adding a method option which defaults to PUT, right? Or are there more things?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've been checking out the http package, to assess the refactor to include POST, and I see that PUT is highly hardcoded in it, it wouldn't be a trivial refactor.

I'm sorry to say I don't have time enough to attack this challenge at the moment.

Would you mind if I finish this Nexus feature loading the environment variable from inside my pipe, and I can hopefully tackle the refactoring of the http package later on?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I rather not.

I can try to take a look at the http package as well...

Copy link
Member

Choose a reason for hiding this comment

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

@antonienko would #1246 work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On a first quick review, it looks great. As soon as it is merged I'll try and complete this PR using it.

Copy link
Member

Choose a reason for hiding this comment

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

merged to master :)

@caarlos0 caarlos0 mentioned this pull request Nov 15, 2019
@stale
Copy link

stale bot commented Dec 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 2, 2019
@stale stale bot closed this Dec 9, 2019
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants