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

ci: overall enhancements and cosmetics improvements #134

Merged
merged 2 commits into from
Mar 31, 2021

Conversation

khos2ow
Copy link
Collaborator

@khos2ow khos2ow commented Mar 31, 2021

What does this do / why do we need it?

This PR enhances Makefile by:

  • adding a help target, and colorizing the outputs of commands
  • normalize Go execution (specifically adding CGO_ENABLED=0 to build)

Also it cosmetically improves CI jobs by:

  • unify them under ci
  • unify naming
  • unify Go version
  • add an [ci skip] switch (if commit message include it, CI will be skipped)

Note: for readability I've splited them into two commits, and I personally prefer to not squash merge them. But not entirely sure what will happen to our changelog if there will be a merge commit. Anyways, either way will work (or if need be I can move one to its own PR)

Check lists

  • Test passed
  • Coding style (indentation, etc)

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
@khos2ow khos2ow added the type: enhancement New enhancement label Mar 31, 2021
@khos2ow khos2ow requested review from clok and mavogel March 31, 2021 00:02
@coveralls
Copy link

Pull Request Test Coverage Report for Build 703224017

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 76.76%

Totals Coverage Status
Change from base Build 702345926: 0.0%
Covered Lines: 1843
Relevant Lines: 2401

💛 - Coveralls

@clok
Copy link
Collaborator

clok commented Mar 31, 2021

I want to note that a "Squash and Merge" will retain the commit messages as markdown bulleted lists in the commit message of the merge. See ae3382b7 as an example. I find this effective at logging the commits within a squashed commit.

The other option is a "Rebase and Merge" which does what it says in the name. That would accomplish truly separating the commits on the main line branch.
image

Typically, I reserve "Rebase and Merge" for items that are deemed to require an atomic separation of the commits to 1) help with maintaining why work was done and 2) allow for a more discrete change set with complex features. I do not support using "Rebase and Merge" when then are 10+ commits within a PR. Just too much noise at that point.

I am open to either in this situation. Let me know your thoughts.

Copy link
Collaborator

@clok clok left a comment

Choose a reason for hiding this comment

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

I have been working with make for a looooong time now and today you taught me some cool and useful stuff! Thank you for this @khos2ow!

You should consider dropping some of this knowledge on https://makefiletutorial.com/. I feel like the help command example could be useful on that tutorial site.

@@ -1,37 +1,93 @@
VERSION?=$$(git describe --tags --always)
# Build variables
VERSION ?= $(shell git describe --tags --always)
Copy link
Collaborator

Choose a reason for hiding this comment

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

TIL: shell replaces newlines with spaces. Hmm

########
##@ Help

.PHONY: help
Copy link
Collaborator

Choose a reason for hiding this comment

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

Man, this is cool! 🍻

.PHONY: help
help: ## Display this help
@awk \
-v "col=\033[36m" -v "nocol=\033[0m" \
Copy link
Collaborator

Choose a reason for hiding this comment

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

🎨

@khos2ow
Copy link
Collaborator Author

khos2ow commented Mar 31, 2021

I want to note that a "Squash and Merge" will retain the commit messages as markdown bulleted lists

That's great, let's go with this. I'm just gonna go on record and say I hate "Rebase and Merge", it's even worse than squash and merge! lol

I feel like the help command example could be useful on that tutorial site.

I cannot take the whole credit here, I merely have modified this a bit along the way in the past working on top of other folks modification (I can take some credit for log-% part of it! 😉). But original help implementation was introduced here: https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html

@khos2ow khos2ow mentioned this pull request Mar 31, 2021
2 tasks
@khos2ow khos2ow changed the title CI and Makefile enhancements ci: overall enhancements and cosmetics improvements Mar 31, 2021
@khos2ow khos2ow merged commit 8d9e00b into git-chglog:master Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants