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

Projects
None yet
6 participants
@4383
Copy link
Contributor

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!

@openshift-ci-robot openshift-ci-robot requested review from baude and mheon Feb 6, 2019

@4383

This comment has been minimized.

Copy link
Contributor Author

4383 commented Feb 6, 2019

/assign @rhatdan

@rh-atomic-bot

This comment has been minimized.

Copy link
Collaborator

rh-atomic-bot commented Feb 6, 2019

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

This comment has been minimized.

Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2019

@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

This comment has been minimized.

Copy link
Member

rhatdan commented Feb 6, 2019

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

@TomSweeneyRedHat

This comment has been minimized.

Copy link
Collaborator

TomSweeneyRedHat commented Feb 6, 2019

/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

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Feb 6, 2019

Collaborator

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

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Feb 6, 2019

Collaborator

s/builted/built/

@openshift-ci-robot

This comment has been minimized.

Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2019

[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

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

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Feb 6, 2019

Collaborator

s/builted/built/

@TomSweeneyRedHat

This comment has been minimized.

Copy link
Collaborator

TomSweeneyRedHat commented Feb 6, 2019

@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.
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 4383 force-pushed the 4383:improve-makefile branch from f6f5d8b to e0c3af6 Feb 6, 2019

@4383

This comment has been minimized.

Copy link
Contributor Author

4383 commented Feb 6, 2019

@TomSweeneyRedHat nits fixed! :)

@openshift-ci-robot

This comment has been minimized.

Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2019

@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

This comment has been minimized.

Copy link
Collaborator

TomSweeneyRedHat commented Feb 6, 2019

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

@rhatdan

This comment has been minimized.

Copy link
Member

rhatdan commented Feb 6, 2019

/lgtm
Thanks @4383

@openshift-merge-robot openshift-merge-robot merged commit 72fcfb7 into containers:master Feb 6, 2019

4 checks passed

ci/prow/images Job succeeded.
Details
ci/prow/lint Job succeeded.
Details
ci/prow/validate Job succeeded.
Details
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment