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

Add Federated Repositories #93

Closed
wants to merge 4 commits into from

Conversation

feliu
Copy link

@feliu feliu commented Jun 1, 2021

Add federated repositories resource type. This PR is a first draft, I still need to implement the attribute members in the resource artifactory_federated_repository.

Context: https://www.jfrog.com/confluence/display/JFROG/Repository+Configuration+JSON#RepositoryConfigurationJSON-FederatedRepository

Tested with Artifactory (SaaS) version 7.19.6.

@github-actions
Copy link

github-actions bot commented Jun 1, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️

@feliu
Copy link
Author

feliu commented Jun 1, 2021

I have read the CLA Document and I hereby sign the CLA

@feliu feliu force-pushed the add-federated-repositories branch from ca09514 to 0cf1ddc Compare June 1, 2021 09:09
@feliu feliu changed the title Add first draft of federated repositories Add Federated Repositories Jun 1, 2021
import (
"context"
"fmt"
"net/http"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not seeing where this gets used

Copy link
Author

Choose a reason for hiding this comment

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

The net/http is used in line 200: if resp.StatusCode == http.StatusNotFound {

@@ -2,6 +2,9 @@ package artifactory

import (
"fmt"
"net/http"
Copy link
Contributor

Choose a reason for hiding this comment

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

You just reordered the imports?

Copy link
Author

Choose a reason for hiding this comment

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

I applied gofmt to have consistent formatting.

@chb0github
Copy link
Contributor

This is listed as a draft. Is it still active?

@feliu
Copy link
Author

feliu commented Jun 11, 2021

Hi @chb0github, I want to test it with my both Artifactory Cloud instances. I opened a ticket to JFrog Support, to help me on setting up a circle of trust between two Artifactory Cloud instances, and I'm still waiting. Once, I get a response from JFrog, I will be able to do a full test and complete this PR. The problem is that there is no documentation about setting a circle of trust between SaaS instances.

@feliu
Copy link
Author

feliu commented Jun 11, 2021

I just received a response from JFrog. in this case, I will be able to work with this task on Monday.

@feliu
Copy link
Author

feliu commented Jun 18, 2021

Depends on: atlassian/go-artifactory#34. Do you know if the repository atlassian/go-artifactory is actively maintained, @chb0github?

@cawilson
Copy link
Contributor

cawilson commented Jun 22, 2021

Depends on: atlassian/go-artifactory#34. Do you know if the repository atlassian/go-artifactory is actively maintained, @chb0github?

From what I can see, Atlassian hasn't touched the repository for 2 years, so I would say they have abandoned it. There are a lot of crucial PR's opened against it, which are required to move this Terraform provider forward and I think, barring any issues, Jfrog needs to take a fork and help drive it forward or replace it with their own API library.

We're really (REALLY) keen for the federated repository support (as an Enterprise+ user) and the lack of support is blocking us from converting local repositories. I feel this PR will be blocked until the API library issues can be sorted. You could write your own API library and pull that in (like what was done for the Xray resources) but I feel this is just going to cause a mass of unnecessary complication/fragmentation.

@chb0github
Copy link
Contributor

@cawilson and @feliu

We have our own Go client so we definitely won't be forking this one. We've inherited enough from atlassian. We are using it a little.

If you are in need of a test server, let me know here or on gitter.

If you want to get some traction on this I would recommend raising a legit support ticket here.

My time is entirely commandeered. I can do PRs, assist with resources, etc. Sorry I can't do more.

@cawilson
Copy link
Contributor

@cawilson and @feliu

We have our own Go client so we definitely won't be forking this one. We've inherited enough from atlassian. We are using it a little.

If you are in need of a test server, let me know here or on gitter.

If you want to get some traction on this I would recommend raising a legit support ticket here.

My time is entirely commandeered. I can do PRs, assist with resources, etc. Sorry I can't do more.

@feliu and @chb0github

Yeah, I thought there was one already. I think one of the biggest things to do, in order to unlock and drive this provider forward, would be to completely remove and replace the Atlassian API library with the Jfrog one. Then we will be able to gain more traction in changes to the API and then changes to this Terraform provider.

I'll see if I can find any time to give it a go, but no guarantees...

@cawilson
Copy link
Contributor

@feliu and @chb0github

I have been looking into all this and started attempts at changing the library across to https://github.com/jfrog/jfrog-client-go but realised the work is a bit large and there are a few key things missing from Jfrog Library that need to be solved. So I'm attempting to only tackle federated repositories first by adding them to the Jfrog Go library (see jfrog/jfrog-client-go#375) and then we should be able to use that instead for the federated repository resources. It means bringing in a third library but I think it can be reduced to the Jfrog one bit by bit

@chb0github
Copy link
Contributor

@cawilson - I agree with you. Completely moving away from anything atlassian at this point would be ideal. Also, solidifying the HTTP client(s) to the jfrog-go one.

@chb0github
Copy link
Contributor

I am in the process right now of pitching atlassian. But, I am seriously reconsidering using our own client. I am going to close this for now. Feel free to reopen when you have something ready

@chb0github chb0github closed this Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants