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

improve dev UX by removing unnecessary toil #236

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

sthaha
Copy link
Collaborator

@sthaha sthaha commented Sep 15, 2023

  • removes unnecessary rebases due to bundle generation
  • Adds make target for installing oc
  • Removes (ab)use of [[ $(command -v ...) ]] with command -v

@sthaha sthaha changed the title cleanup: hack/tools install script improve dev UX by removing unnecessary toil Sep 15, 2023
Previously, `make bundle` will update the `createdAt` of the bundle CSV
file even if there aren't any changes to the config. This requires PRs
to be rebased to resolve the conflict in createdAt. This PR changes the
bundle generation to revert the CSV file if the only change detected is
for the `createdAt` timestamp, there by saving us from unnecessary
rebases.

Signed-off-by: Sunil Thaha <[email protected]>
Makefile Outdated
@@ -265,6 +265,10 @@ operator-sdk: ## Download operator-sdk locally if necessary.
yq: ## Download yq locally if necessary
@./hack/tools.sh yq

.PHONY: oc
oc: ## Download yq locally if necessary
Copy link
Collaborator

Choose a reason for hiding this comment

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

comment says yq

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch :)


if git diff --ignore-matching-lines='createdAt:' --exit-code "$csv_file" >/dev/null; then
info "no changes to $(basename $csv_file) detected; resetting it"
run git checkout -- "$csv_file"
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it safe to do git checkout from script

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, the git diff explicitly checks if the only change is in createdAt ..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

* Adds make target for installing oc
* Removes (ab)use of [[ $(command -v ...) ]] with command -v

Signed-off-by: Sunil Thaha <[email protected]>
@vimalk78 vimalk78 merged commit 71dab20 into sustainable-computing-io:v1alpha1 Sep 15, 2023
9 checks passed
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.

2 participants