Skip to content

Conversation

a-hilaly
Copy link
Member

Issue aws-controllers-k8s/community#809

Description of changes:

This patch adds a cobra PostRunE function that writes generator
parameters, output metadata and generated files checksum, to a
file within the API versions directory.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-bot ack-bot requested review from jaypipes and vijtrip2 June 16, 2021 23:03
@a-hilaly
Copy link
Member Author

a-hilaly commented Jun 16, 2021

Output file example:

ack_generate_info:
  build_date: "2021-06-16T23:37:20Z"
  build_hash: 7c95857954866cfd7f87576cc7abfe26b40c0ee7
  go_version: go1.16.4 linux/amd64
  version: v0.0.0
api_directory_checksum: 4ffda010495d8ff251f0959fbc4b23d22d4a4615
api_version: v1alpha1
aws_sdk_go_version: v1.35.35
generator_config_info:
  file_checksum: f31970ae673c4e8d77bf66ed09ec7a34f76569f2
  original_file_name: generator.yaml
last_modification:
  reason: API generation
  timestamp: 2021-06-16 23:51:34.850963058 +0000 UTC

@a-hilaly a-hilaly force-pushed the generation-artifacts branch from 5959cf4 to 7c95857 Compare June 16, 2021 23:06
@a-hilaly a-hilaly changed the title Generation artifacts Add a cobra PostRunE to save generation metadata Jun 16, 2021
@a-hilaly a-hilaly force-pushed the generation-artifacts branch 2 times, most recently from 0ec7d18 to 99b7cec Compare June 16, 2021 23:54
Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

great stuff, @a-hilaly :) Few minor suggestions/requests for you inline but this is awesome!

@a-hilaly a-hilaly force-pushed the generation-artifacts branch from 99b7cec to 50f9f7e Compare June 17, 2021 10:48
@a-hilaly
Copy link
Member Author

@jaypipes @RedbackThomson if all looks good, can we give this PR a manual merge? i think that we should keep the LDFLAGS modifications separated from the generation metadata stuff

// express or implied. See the License for the specific language governing
// permissions and limitations under the License.

package output
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry if I wasn't clear... I meant can we put this file into pkg/generate/ack instead of pkg/generate/ack/output?

Copy link
Member Author

Choose a reason for hiding this comment

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

Gotcha! Moved to pkg/generate/ack/output.go

@a-hilaly a-hilaly force-pushed the generation-artifacts branch from 50f9f7e to 5736382 Compare June 17, 2021 14:39
a-hilaly added 2 commits June 17, 2021 16:58
…API directory

- Add an output files containing utilities and functions to create/save the generation metadata files
@a-hilaly a-hilaly force-pushed the generation-artifacts branch from 5736382 to 1f90f1a Compare June 17, 2021 14:58
@jaypipes
Copy link
Collaborator

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2021
@ack-bot
Copy link
Collaborator

ack-bot commented Jun 17, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, jaypipes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit 8e82f0a into aws-controllers-k8s:main Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants