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

Generate make helping message dynamicaly. #2283

Merged
merged 1 commit into from Feb 6, 2019

Conversation

4383
Copy link
Contributor

@4383 4383 commented Feb 6, 2019

Summarize

Generate make helping message dynamicaly by using
python code snippet inside Makefile.

All commented make targets will be added to the
help message. To be added to the helping message
comment need to start with '## '.

These specials comments are detected by the python code.
Python code generate the helping output from these results.

Notice that this commit introduce a dependency with python (compatible python 2 and 3).

Signed-off-by: Hervé Beraud hberaud@redhat.com

Sample output

My changes generate the following outputs:

$ make help                                                                                                                          
Usage: make <target>                                                                                                                                                                                                 
 * 'binaries' - Build podman                                                                                                                                                                                         
 * 'changelog' - Generate changelog                                                                                                                                                                                  
 * 'clean' - Clean artifacts                                                                                                                                                                                         
 * 'docs' - Generate documentation                                                                                                                                                                                   
 * 'gofmt' - Verify the source code gofmt                                                                                                                                                                            
 * 'install' - Install binaries to system locations                                                                                                                                                                  
 * 'integration' - Execute integration tests                                                                                                                                                                         
 * 'libpodimage' - Build the libpod image                                                                                                                                                                            
 * 'lint' - Execute the source code linter                                                                                                                                                                           
 * 'local-cross' - Cross local compilation                                                                                                                                                                           
 * 'perftest' - Build perf tests                                                                                                                                                                                     
 * 'podman' - Build with podman                                                                                                                                                                                      
 * 'podman-remote' - Build with podman on remote environment                                                                                                                                                         
 * 'podman-remote-darwin' - Build with podman on remote OSX environment                                                                                                                                              
 * 'run-perftest' - Build and run perf tests                                                                                                                                                                         
 * 'shell' - Run the builted image and attach a shell                                                                                                                                                                
 * 'test' - Run tests on builted image                                                                                                                                                                               
 * 'testunit' - Run unittest on the builted image     

You can test them by using the following commands:

$ git clone https://github.com/4383/libpod -b improve-makefile
$ cd libpod
$ make help # generate the previous output
...

Warning

  • These changes introduce a dependency with python 2 or 3.
  • I doesn't comment all targets due to a lack of knowledge about them. Feel free to ask to me to complet these comments with your knowledges about them.

Cheers!

@4383
Copy link
Contributor Author

4383 commented Feb 6, 2019

/assign @rhatdan

@rh-atomic-bot
Copy link
Collaborator

Can one of the admins verify this patch?
I understand the following commands:

  • bot, add author to whitelist
  • bot, test pull request
  • bot, test pull request once

@openshift-ci-robot
Copy link
Collaborator

@4383: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/assign @rhatdan

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rhatdan
Copy link
Member

rhatdan commented Feb 6, 2019

bot, add author to whitelist
LGTM
@mheon @baude @umohnani8 @giuseppe @vrothberg @TomSweeneyRedHat PTAL

@TomSweeneyRedHat
Copy link
Member

/approve

Makefile Outdated
@@ -164,10 +172,10 @@ integration.fedora:
integration.centos:
DIST=CentOS sh .papr_prepare.sh

shell: libpodimage
shell: libpodimage ## Run the builted image and attach a shell
Copy link
Member

Choose a reason for hiding this comment

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

s/buillted/built/

Makefile Outdated
${CONTAINER_RUNTIME} run -e STORAGE_OPTIONS="--storage-driver=vfs" -e CGROUP_MANAGER=cgroupfs -e TESTFLAGS -e OCI_RUNTIME -e TRAVIS -it --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} sh

testunit: libpodimage
testunit: libpodimage ## Run unittest on the builted image
Copy link
Member

Choose a reason for hiding this comment

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

s/builted/built/

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 4383, TomSweeneyRedHat

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 6, 2019
Makefile Outdated
${CONTAINER_RUNTIME} build -t ${LIBPOD_IMAGE} .

dbuild: libpodimage
${CONTAINER_RUNTIME} run --name=${LIBPOD_INSTANCE} --privileged -v ${PWD}:/go/src/${PROJECT} --rm ${LIBPOD_IMAGE} make all

test: libpodimage
test: libpodimage ## Run tests on builted image
Copy link
Member

Choose a reason for hiding this comment

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

s/builted/built/

@TomSweeneyRedHat
Copy link
Member

@4383 thanks for the PR. I like the look/feel of this, thanks for posting the PR. I found a few nits that I commented on. The python dependency I'm a little cautious on, but good to hear it works with python 2 or 3. I think adding a python dependency is OK, but I'll let others weigh in on that.

Generate make helping message dynamicaly by using
python code snippet inside Makefile.

All commented make targets will be added to the
help message. To be added to the helping message
comment need to start with '## '.

These specials comments are detected by the python code.
Python code generate the helping output from these results.

Notice that this commit introduce a dependency with python (compatible python 2 and 3).

Signed-off-by: Hervé Beraud <hberaud@redhat.com>
@4383
Copy link
Contributor Author

4383 commented Feb 6, 2019

@TomSweeneyRedHat nits fixed! :)

@openshift-ci-robot
Copy link
Collaborator

@4383: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

@TomSweeneyRedHat nits fixed! :)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@TomSweeneyRedHat
Copy link
Member

LGTM, assuming happy tests and the Python dependency being hip with others.

@rhatdan
Copy link
Member

rhatdan commented Feb 6, 2019

/lgtm
Thanks @4383

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 6, 2019
@openshift-merge-robot openshift-merge-robot merged commit 72fcfb7 into containers:master Feb 6, 2019
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants