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

[make] Provide built command in the module output #6160

Merged
merged 1 commit into from
Mar 14, 2023

Conversation

cjeanner
Copy link
Contributor

@cjeanner cjeanner commented Mar 8, 2023

It may happen operator wants to get the built command instead of all the parameters. This change injects a new entry in the dict output, showing what command way actually launched.

SUMMARY

This change adds a new information to the community.general.make module output: the built command that way
launched by the run_command.

The goal here is to help operator debugging potential issues, or just allow them to store this information in a log, for
instance.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

make

ADDITIONAL INFORMATION

Before:

ok: [localhost] => {
    "make_output": {
        "changed": true,
        "chdir": "/tmp/foo",
        "failed": false,
        "file": null,
        "jobs": null,
        "params": null,
        "stderr": "",
        "stderr_lines": [],
        "stdout": "foo\ntouch /tmp/foo.done",
        "stdout_lines": [
            "foo",
            "touch /tmp/foo.done"
        ],
        "target": "test"
    }
}

After:

ok: [localhost] => {
    "make_output": {
        "changed": true,
        "chdir": "/tmp/foo",
        "command": "/usr/bin/gmake test",
        "failed": false,
        "file": null,
        "jobs": null,
        "params": null,
        "stderr": "",
        "stderr_lines": [],
        "stdout": "foo\ntouch /tmp/foo.done",
        "stdout_lines": [
            "foo",
            "touch /tmp/foo.done"
        ],
        "target": "test"
    }
}

@ansibullbot
Copy link
Collaborator

cc @LinusU
click here for bot help

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type) system labels Mar 8, 2023
@cjeanner
Copy link
Contributor Author

cjeanner commented Mar 8, 2023

/hold

We may want to wait for #6161 first. I'll rebase and add the appropriate doc entry.

changelogs/fragments/6160-add-command-make-output.yml Outdated Show resolved Hide resolved
plugins/modules/make.py Outdated Show resolved Hide resolved
@cjeanner
Copy link
Contributor Author

cjeanner commented Mar 8, 2023

Doc patch merged, this one is now rebased against main, and integrates the asked modifications. We can therefore continue with reviews here, should be ready.

@ansibullbot ansibullbot removed the new_contributor Help guide this first time contributor label Mar 8, 2023
@github-actions
Copy link

github-actions bot commented Mar 8, 2023

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@cjeanner cjeanner requested a review from felixfontein March 8, 2023 15:58
cjeanner added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Mar 8, 2023
The action plugin will make the whole thing faster. It requires a tiny
change to the community.general.make module[1].

[1] ansible-collections/community.general#6160
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-6 labels Mar 8, 2023
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Besides this, looks good to me.

plugins/modules/make.py Show resolved Hide resolved
@cjeanner cjeanner requested a review from felixfontein March 9, 2023 07:47
cjeanner added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Mar 9, 2023
Replacing a whole role by a single action plugin allows a faster run,
while reducing drastically the amount of tasks.

Note that this action plugin requires a small change to the
community.general.make module[1] - it should be merged in the following
hours/days.

[1] ansible-collections/community.general#6160
cjeanner added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Mar 9, 2023
Replacing a whole role by a single action plugin allows a faster run,
while reducing drastically the amount of tasks.

Note that this action plugin requires a small change to the
community.general.make module[1] - it should be merged in the following
hours/days.

[1] ansible-collections/community.general#6160
It may happen operator wants to get the built command instead of all the
parameters. This change injects a new entry in the dict output, showing
what command way actually launched.

This patch also takes the opportunity to add missing dots to some
documentation lines.
@cjeanner cjeanner requested a review from felixfontein March 9, 2023 12:48
cjeanner added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Mar 9, 2023
Replacing a whole role by a single action plugin allows a faster run,
while reducing drastically the amount of tasks.

Note that this action plugin requires a small change to the
community.general.make module[1] - it should be merged in the following
hours/days.

[1] ansible-collections/community.general#6160
cjeanner added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Mar 9, 2023
Replacing a whole role by a single action plugin allows a faster run,
while reducing drastically the amount of tasks.

Note that this action plugin requires a small change to the
community.general.make module[1] - it should be merged in the following
hours/days.

[1] ansible-collections/community.general#6160
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Looks good to me. If nobody objects. I'll merge this beginning of next week.

cjeanner added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Mar 14, 2023
Replacing a whole role by a single action plugin allows a faster run,
while reducing drastically the amount of tasks.

Note that this action plugin requires a small change to the
community.general.make module[1] - it should be merged in the following
hours/days.

[1] ansible-collections/community.general#6160
@felixfontein felixfontein merged commit a49ad34 into ansible-collections:main Mar 14, 2023
@patchback
Copy link

patchback bot commented Mar 14, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/a49ad340af86680440ec502af65f667e8bbb6ff9/pr-6160

Backported as #6186

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Mar 14, 2023
patchback bot pushed a commit that referenced this pull request Mar 14, 2023
It may happen operator wants to get the built command instead of all the
parameters. This change injects a new entry in the dict output, showing
what command way actually launched.

This patch also takes the opportunity to add missing dots to some
documentation lines.

(cherry picked from commit a49ad34)
@felixfontein
Copy link
Collaborator

@cjeanner thanks for your contribution!

@cjeanner cjeanner deleted the make/command branch March 14, 2023 19:54
felixfontein pushed a commit that referenced this pull request Mar 14, 2023
…n the module output (#6186)

[make] Provide built command in the module output (#6160)

It may happen operator wants to get the built command instead of all the
parameters. This change injects a new entry in the dict output, showing
what command way actually launched.

This patch also takes the opportunity to add missing dots to some
documentation lines.

(cherry picked from commit a49ad34)

Co-authored-by: Cédric Jeanneret <39397510+cjeanner@users.noreply.github.com>
cjeanner added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Mar 14, 2023
Replacing a whole role by a single action plugin allows a faster run,
while reducing drastically the amount of tasks.

Note that this action plugin requires a small change to the
community.general.make module[1] - it should be merged in the following
hours/days.

[1] ansible-collections/community.general#6160
cjeanner added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Mar 15, 2023
Replacing a whole role by a single action plugin allows a faster run,
while reducing drastically the amount of tasks.

We also expose the "plugins" directory at the root of the repository for
an easier consumption.

Note that this action plugin requires a small change to the
community.general.make module[1] - it should be merged in the following
hours/days.

[1] ansible-collections/community.general#6160
cjeanner added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Mar 15, 2023
Replacing a whole role by a single action plugin allows a faster run,
while reducing drastically the amount of tasks.

We also expose the "plugins" directory at the root of the repository for
an easier consumption.

Note that this action plugin requires a small change to the
community.general.make module[1] - it should be merged in the following
hours/days.

[1] ansible-collections/community.general#6160
cjeanner added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Mar 15, 2023
Replacing a whole role by a single action plugin allows a faster run,
while reducing drastically the amount of tasks.

We also expose the "plugins" directory at the root of the repository for
an easier consumption.

You want to ensure you're using latest community.general ansible
collection, in order to get the new "command" output value[1].

[1] ansible-collections/community.general#6160
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request module module plugins plugin (any type) system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants