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 function to tile package for reading metadata from a tanzunet product file #435

Conversation

crhntr
Copy link
Contributor

@crhntr crhntr commented Aug 17, 2023

This will be helpful for making kiln test tile revisions against recently released tiles.

I intend to use this on a few upcoming features but am adding it now because this function is a helpful utility that TAS Operability may get value from.

I intentionally did not use the pivnet package because we use various versions of that module in this package. Once #318 is merged, we may want to re-evaluate this API. As it is, this implementation might work with Artifactory. I expect a future utility function to call this and pass in the appropriate information from a pivnet.ProductFile (ppet has an example of how to do this if the test comment is not enough).

This test change also switches from "gomega" to "testify/assert" for the tile package. We have talked about whether or not to do this for the whole project. For now, I think we should converge to one set of tools per package. Each package may have different needs served better by Gomega/Ginkgo, godog, standard library alone, or standard library + testify.

Example

// create http.Request from pivnet.ProductFile
downloadLink, _ := productFile.DownloadLink()
ctx := context.Background()
req, _ := http.NewRequestWithContext(ctx, http.MethodGet, downloadLink, nil)
// on a real request you need to set "Authorization" and "User-Agent" headers

metadataBytes, _ := tile.ReadMetadataFromServer(http.DefaultClient, req)
// see test for running example

…p.Request

this is so the server can be something other than TanzuNet, maybe artifactory?
…oductFile

this new name better aligns with the generality of this utility
@cf-gitbot
Copy link
Member

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

@crhntr crhntr force-pushed the add-function-to-tile-package-for-reading-metadata-from-a-tanzunet-product-file branch from 16e5122 to 876ea30 Compare August 17, 2023 01:11
@pabloarodas pabloarodas merged commit f4a304a into main Aug 29, 2023
5 checks passed
@pabloarodas pabloarodas deleted the add-function-to-tile-package-for-reading-metadata-from-a-tanzunet-product-file branch August 29, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants