-
Notifications
You must be signed in to change notification settings - Fork 42
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
datasources added: artifactory_file & artifactory_fileinfo #65
Conversation
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.
Hi, thanks for the contribution. Now that Dillon, the original maintainer, has left the company we are still trying to determine how we are going to handle these repos. Unfortunately my knowledge of Go is limited but I'll make sure I get someone to look into this PR and the PR in go-artifactory in the next few days.
Hey @ttsangAtlassian, may I ask you for an update? Please let me know if you do need any further help from my side. Thanks, |
@volkc-basf apologies. I will try and take a look today. I have noticed that the formatting is failing to pass in the build test. Could you fix that up? |
@jamestoyer Hope it's okay now. |
@volkc-basf I've gone ahead and released v2.5.0 of the go-artifactory client library. Could you update to it and check that everything works as expected? 🙂 |
@jamestoyer: From my side, everything looks very good ;-) |
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.
Looking through this I think what you really want are two data sources. One for the File Info and one to get the file. Right now it feels like you're trying to do both in one go and there could be scenarios where you want to only get the File Info.
It would be good to also add to the documentation in website/docs/r
Do you have a use case for that, where someone is only interested in file metadata? I mean Terraform is built to deploy certain things, hence I believe people are more interested in the raw file rather than in its metadata. But of course, one thing we could discuss is to make the output_path property mandatory. |
Importer is also not needed
I can think of a few scenarios whereby you might only want one or the other
In both scenarios you don't want the file at first, but may want it later. Having an optional field which modifies the download behaviour of the file feels like it's making the process more opaque. |
Okay, I don't mind. Added a second dataSource called artifactory_fileinfo, that can be used to access the metadata only and in parallel I set the output_path in artifactory_file as required. Docs are also there now. |
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.
Looks good. I think we're almost there. I'm not sure we still need the SkipDownload
method now or if we do it can be simplified just to check the SHAs of an existing file
return err | ||
} | ||
|
||
skip, err := SkipDownload(fileInfo, outputPath) |
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.
Now that output_path
is required, do we still need this? Maybe the verification of the SHAs can be here instead
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've tried to refactor that part, however I believe it's not safe to verify the checksum only. There are multiple reasons why the checksum verification could fail:
- file doesn't exist
- any problems with the hash library
- io issues
However we only want to proceed with the download in the first case. Having that said, we'll still need to check whether the file exists or not.
@jamestoyer: The build is failing with "Please check your payment method or billing status.", could you please check that? |
😞 @ttsangAtlassian have actions been turned off for this repo? |
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.
It looks good. I'll just wait for @ttsangAtlassian to check what's happened to the GitHub actions then we can get this merged.
Perfect, thank you for your help! |
I have a bad feeling we are being bitten by this https://github.community/t5/GitHub-Actions/GitHub-Actions-workflows-can-t-be-executed-on-this-repository/td-p/38153 It looks like when actions went GA on Nov 14th, legacy plans had actions disabled for all plans including OSS. I'll try and chase this up |
@ttsangAtlassian: How is it? Hope you have some positive news for me l;-) |
@volkc-basf I'm sorry we are still trying to work out what is happening with our licenses on our end. For now I am happy to remove the build checks to get this merged. |
This PR implements #63, means it will add support to download artifacts using terraform. It won't compile as long as atlassian/go-artifactory#19 is not merged.
Best,
Chris