Skip to content

Conversation

RedbackThomson
Copy link
Contributor

Description of changes:
Adds a script that compares the aws-controllers-k8s/runtime version listed in the go.mod is identical to the VERSION variable in the Makefile. This way we can ensure the generation metadata is kept in line with the version of the runtime it was built against.

/assign @a-hilaly

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

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

Nicee! With this CI job we'll never forget to update the version in the Makefile :) ! Left one small suggestion

fi

RUNTIME_DEPENDENCY_VERSION="aws-controllers-k8s/runtime"
GO_MOD_VERSION=$(cat go.mod | grep $RUNTIME_DEPENDENCY_VERSION | cut -d ' ' -f2)
Copy link
Member

Choose a reason for hiding this comment

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

nit: you can also use go list to get the version ack/runtime module. Some thing similar to:

go list -m -f '{{ .Version }}' github.com/aws-controllers-k8s/runtime

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh super cool! Thanks!

@RedbackThomson
Copy link
Contributor Author

I was hoping we could include this into something more akin to a Git hook - so that changes would not even make it into a branch. However, Git hooks are not included in the remote repository and I didn't want to require developers to manually enable them (no-one would, probably). This was my next best option.

fi

RUNTIME_DEPENDENCY_VERSION="aws-controllers-k8s/runtime"
GO_MOD_VERSION=$(go list -m -f '{{ .Version }}' github.com/aws-controllers-k8s/runtime)
Copy link
Member

Choose a reason for hiding this comment

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

GO_MOD_PATH is not used, you can add another flag to specify the go.mod file: -modfile $GO_MOD_PATH

@a-hilaly
Copy link
Member

/lgtm

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

ack-bot commented Jul 21, 2021

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [A-Hilaly,RedbackThomson]

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

@a-hilaly a-hilaly merged commit c876663 into aws-controllers-k8s:main Jul 21, 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.

3 participants