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

sat-3016 - Added/Edited new chapter/assembly about foreman webhooks #636

Closed
wants to merge 9 commits into from

Conversation

neal-timpe
Copy link

Edited previous work on foreman webhooks.

[doc] Foreman Webhooks

https://issues.redhat.com/browse/SAT-3106

Cherry-pick into:

  • Foreman 2.5 (Satellite 6.10)
  • Foreman 2.4
  • Foreman 2.3 (Satellite 6.9)
  • Foreman 2.1 (Satellite 6.8)

@melcorr
Copy link
Member

melcorr commented Jul 27, 2021

Hello and welcome.

I am... confused... - we have also PR #612

What is occurring :o)

@neal-timpe
Copy link
Author

Hi @melcorr , @ianf77 and the team asked me to work on this so Ian could work on other things. I've recreated his PR and attempted to address some of the concerns that you had raised in #612 .

@melcorr
Copy link
Member

melcorr commented Jul 27, 2021

Hi @melcorr , @ianf77 and the team asked me to work on this so Ian could work on other things. I've recreated his PR and attempted to address some of the concerns that you had raised in #612 .

Hey @neal-timpe thank you for clarifying.
Are you able to build the docs locally and test that the attributes are correct and render and the URLs etc are OK? That would be very helpful. I can already see some feedback from the previous PR that was not applied.

If you haven't set yourself up for local tests, please follow: https://github.com/theforeman/foreman-documentation/blob/master/guides/README.md#building

I appreciate you helping out!

@neal-timpe
Copy link
Author

@melcorr Yes, I set up the tools and ran a build. It looks okay to me and the links work.

I also went back through to make sure there was one sentence per line.
I added some context to the creating a webhook module
I also removed the templates module after chatting with Ian.

What else do you see? Which items did I miss?

Copy link
Member

@melcorr melcorr left a comment

Choose a reason for hiding this comment

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

Hey @neal-timpe - thanks so much.

I pointed to the attribute that I immediately saw and had pointed out in the other PR. There is no way this can build correctly.

Now you have confirmed you have built locally, I will review this in the morning.

I appreciate you getting back to me and your contribution.
Thanks,
Melanie

guides/common/modules/proc_creating-a-webhook.adoc Outdated Show resolved Hide resolved
Copy link
Member

@melcorr melcorr left a comment

Choose a reason for hiding this comment

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

Hey Neal,
Firstly, this is a great first contribution and thank you for reacting to my earlier comments, for confirming that you have built locally, and for implementing the initial feedback. It's not easy to come into a project half way through a work in progress. I appreciate your efforts and responsiveness.

Overall, we are very much on track with this.

My major concern is that the information about webhooks and shellhooks should be treated separately and have separate procedures.
The engineer's notes probably had them jumbled together, but this isn't really standard throughout our docset. You could either clone the files (easiest) and create shellhooks procedures, or conditionalise the files and have them print twice depending on the context set. As it is now, in the organization of the chapter. This really doesn't seem consistent with the rest of our docs. However, it's an easy enough thing to fix!

If you're unsure about anything, let me know.

@ofedoren - in the absence of lzap, would you mind having a quick look through these procedures? If you can, could you confirm how foreman_hooks is referred to in the downstream? Can you give a general + or - to these docs?

guides/common/modules/proc_creating-a-webhook.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_creating-a-webhook.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_creating-a-webhook.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_creating-a-webhook.adoc Outdated Show resolved Hide resolved
# {foreman-installer} --enable-foreman-plugin-webhooks
----

* Optionally, install the shellhooks plugin on each {SmartProxy} used for shellhooks, using the following command:
Copy link
Member

Choose a reason for hiding this comment

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

I find it so strange that in the introduction that we do not provide any info about shellhooks, yet we are telling people they can install it straight away. Seems a bit inconsistent for users?

Copy link
Author

Choose a reason for hiding this comment

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

I agree. What if we added a sentence that said, for more information, see the shellhooks and have an xref to the shellhooks procedure.

guides/common/modules/proc_creating-a-webhook.adoc Outdated Show resolved Hide resolved
guides/common/modules/ref_shellhooks.adoc Outdated Show resolved Hide resolved
Copy link
Member

@ofedoren ofedoren left a comment

Choose a reason for hiding this comment

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

Few more nitpicks.

@neal-timpe
Copy link
Author

@melcorr I've addressed your comments. I'm not sure if I've chosen the correct title for the Shellhooks reference topic. I chose Shellhooks usage details. I acknowledge that may not be it, but I wanted to move forward. Anyway. I think I'm ready for another look. I also responded to one of your comments that is unresolved. I wanted to ask if that's an acceptable solution before I did it. Thanks!

@melcorr
Copy link
Member

melcorr commented Aug 3, 2021

@neal-timpe I will review this in the morning and get back to you!

Copy link
Member

@melcorr melcorr left a comment

Choose a reason for hiding this comment

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

Can you please use this standard when writing commit messages:

https://chris.beams.io/posts/git-commit/

Copy link
Member

@melcorr melcorr left a comment

Choose a reason for hiding this comment

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

Neal can you take a look at your local setup please?
I've pulled your fork, am in sync with your commits, but when I preview locally, I don't see the changes. I've rechecked a few times now, make clean and rebuilding.

@melcorr
Copy link
Member

melcorr commented Aug 4, 2021

Just for the record, I cloned your fork to a fresh folder, downloaded, checked your logs, and still this does not look right.

Edit: as in I tried it again, at the end of my day

@neal-timpe
Copy link
Author

@melcorr I'm not sure what to check here. What doesn't look right about it?

I have built locally and it looks fine to me. What should I be looking for?

Copy link
Member

@melcorr melcorr left a comment

Choose a reason for hiding this comment

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

Hey @neal-timpe,
Apologies.
In the end, this was my bad.
To explain: I tried a few times yesterday and was convinced something was wrong: I believed that items in an earlier commit from you were overwritten.
This morning, when I looked again, I saw that I was just thrown by a few items that I was convinced you had changed in your commits that were in fact not updated. I've flagged them.
Elise wrote to me yesterday that you have limited availability to continue working on this.
Not merging things that are incomplete is a standard practice in both docs and code, so I'm quite bewildered as to how to proceed.

Traditionally, when we have worked on feature docs, we have often gone through a few reviews because as the information is clarified, some other holes are revealed.
For you, I've made a number of comments for additional small changes, but as you are aware the shellhooks issue still exists.
I think that one thing that would help would be to move all the conceptual topics above the procedure for installing webhooks in the chapter.

I'm hoping that in Lukas's absence that @ares or @ofedoren might add some insight here that might then clear up the reasons for having webhooks and shellhooks referenced throughout so that we can better explain it to users. I think we are missing vital context here.

We have a section talking about migration from shellhooks to webhooks.
We have nothing about the advantages of working with combined webhooks and shellhooks yet the installation procedures are combined.
Do we want users to blend shellhooks and webhooks?
Should they be treated separately ?
Do we think users should install both simultaneously?
Should we be encouraging users to move entirely to webhooks and therefore talk about migration but move away from shellhooks (aka delete references to installing them)?

guides/common/assembly_using-foreman-webhooks.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_creating-a-webhook.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_creating-a-webhook.adoc Outdated Show resolved Hide resolved
guides/common/modules/ref_shellhooks.adoc Outdated Show resolved Hide resolved
guides/common/modules/ref_shellhooks.adoc Outdated Show resolved Hide resolved
guides/common/modules/ref_webhooks-available-events.adoc Outdated Show resolved Hide resolved
guides/common/modules/ref_webhooks-available-events.adoc Outdated Show resolved Hide resolved
@ofedoren
Copy link
Member

ofedoren commented Aug 5, 2021

@melcorr, I'll try to answer those questions:

We have a section talking about migration from shellhooks to webhooks.

That's quite wrong. We don't migrate from Shellhooks to Webhooks. We migrate from Hooks (foreman_hooks plugin) to Webhooks (foreman_webhooks plugin), but with additional Shellhooks (smart_proxy_shellhooks plugin) to achieve or to preserve almost compatible functionallity which we're dropping (Hooks).

We have nothing about the advantages of working with combined webhooks and shellhooks yet the installation procedures are combined.

It's worth to mention that Webhooks is the new way for dealing with events that occur on the server (Satellite/Foreman). It is not compatible with the current way (Hooks). To make migration easier we provide additional plugin for proxy (Capsule/Smart Proxy) called Shellhooks, so with a combination of these two we can support Hooks behaviour on a certain level.

Do we want users to blend shellhooks and webhooks?

Well, depends on users' use-cases. Hooks allows to kind of subscribe on any event that can occur on the server to run scripts on a machine. Webhooks allows to subscribe only on a subset of events we provide and support to make HTTP calls to a third party applications (which means any application that accepts HTTP calls). To be able to run scripts on a machine you would simply need to install Shellhooks.

Should they be treated separately ?

Webhooks can be installed and used separately, but I'm not so sure about Shellhooks. I guess it doesn't make sense to install it without Webhooks.

Do we think users should install both simultaneously?

I guess yes, only if they want similar functionality as with Hooks. Although they can be installed and configured separately.

Should we be encouraging users to move entirely to webhooks and therefore talk about migration but move away from shellhooks (aka delete references to installing them)?

We should encourage users to move to Webhooks + Shellhooks instead of using Hooks.

@neal-timpe
Copy link
Author

@melcorr I've done my best to incorporate the feedback that you gave. Thanks for taking the time to look through this again. I'm just filling in and I'm not on the Satellite team, so I don't know the answers to your questions. I'm not sure if I need to make more changes based on what @ofedoren said.

I agree and I don't want you to merge things you feel aren't ready. However, my role here is to make changes to someone else's content. I'm happy to make more changes to this if you feel they are necessary.

I also don't want to say I can't, because finding the answers to these questions is possible, but it requires me joining the team and doing a bunch more research.

@melcorr
Copy link
Member

melcorr commented Aug 6, 2021

Hey @neal-timpe
I appreciate you doing what you can.
Firstly, no one communicated with me what was within or outside of your remit to complete. This PR just appeared alongside another identical PR and I had to then re-do a review to ensure all feedback was carried over.
I'm not on the docs team and have provided thorough reviews both for you and Ian so that these docs are up to the standard expected by Red Hat and in line with the rest of the Satellite docset.
At no point have I been informed that there was no one actually to fulfill the feedback.
I've also pulled engineers into this discussion to further help with developing the information and they gave up their time only now for their feedback to not make it in.
The whole idea of having a tech writer develop documentation that it is more than the engineers notes and gives adequate context.
If I were to merge the documentation as is, with the palpable confusion that I flagged and Oleh has clarified, it would give the impression that I stand over incomplete work.
This is a suboptimal position to be in three months after the initial request to have a tech writer develop the original engineering notes. This has also been a very expensive exercise, if you think of how many people have contributed.
I appreciate that it isn't necessarily your responsibility, but I don't know what else to do or say.
Again, thank you for everything you've done. It would be great to have someone with your experience working with us.
All the best,
Melanie

+
A webhook HTTP payload must be created using {Project} template syntax.
+
For more information, see {ManagingHostsDocURL}appe-red_hat_satellite-managing_hosts-template_writing_reference[Template Writing Reference] in _Managing Hosts_ and for available template macros and methods, visit `/templates_doc` on {ProjectServer}.
Copy link
Contributor

Choose a reason for hiding this comment

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

The anchor has been changed, see guides/doc-Managing_Hosts/topics/Template_Writing.adoc:4:[[appe-Managing_Hosts-Template_Writing_Reference]]

Suggested change
For more information, see {ManagingHostsDocURL}appe-red_hat_satellite-managing_hosts-template_writing_reference[Template Writing Reference] in _Managing Hosts_ and for available template macros and methods, visit `/templates_doc` on {ProjectServer}.
For more information, see {ManagingHostsDocURL}appe-Managing_Hosts-Template_Writing_Reference[Template Writing Reference] in _Managing Hosts_ and for available template macros and methods, visit `/templates_doc` on {ProjectServer}.

[id="creating-a-webhook_{context}"]
= Creating a Webhook

You can customize events, payloads, HTTP authentication, content type and headers through {ProjectWebUI}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can customize events, payloads, HTTP authentication, content type and headers through {ProjectWebUI}.
You can customize events, payloads, HTTP authentication, content type, and headers through {ProjectWebUI}.

See IBM Style Guide: 'Commas between items in a series'. Can you confirm this @melcorr ?

. Click *Create Webhook*.
. Click *Subscribe to* to select an event.
. Enter a name.
. Enter a target URL. The target URL can be a dynamic URL.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
. Enter a target URL. The target URL can be a dynamic URL.
. Enter a target URL.
The target URL can be a dynamic URL.

. Click *Subscribe to* to select an event.
. Enter a name.
. Enter a target URL. The target URL can be a dynamic URL.
When using the shellhooks plugin, the URL should be in the form of `https://{smartproxy-example-com}:{smartproxy_port}/shellhooks/my_script`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When using the shellhooks plugin, the URL should be in the form of `https://{smartproxy-example-com}:{smartproxy_port}/shellhooks/my_script`.
When using the shellhooks plugin, the URL should be in the form of `\https://{smartproxy-example-com}:{smartproxy_port}/shellhooks/my_script`.

Adding the backslash make the link "unclickable" in asciidoc.

. Enter an HTTP method.
. Check the *Enabled* flag if you want to create an active webhook.
. Click the *Credentials* tab.
. Optional: Enter the username and password when HTTP authentication is required.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
. Optional: Enter the username and password when HTTP authentication is required.
. Optional: If HTTP authentication is required, enter the username and password.

IBM Style Guide: purpose before action.


The scope of what is available is limited by the safemode and all objects and macros are both subject to API stability promise and are fully documented.

The number of events triggered by webhooks is substantially less than with `foreman_hooks`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The number of events triggered by webhooks is substantially less than with `foreman_hooks`.
The number of events triggered by webhooks is substantially fewer than with `foreman_hooks`.

50% sure, but not a native speaker. @melcorr


The number of events triggered by webhooks is substantially less than with `foreman_hooks`.

{Project} are designed to be safe.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please rephrase this? I am unsure what's the purpose of this statement.

{Project} are designed to be safe.
Webhooks are processed asynchronously so there is minimal risk of tampering with internals of the system.
It is not possible to migrate from `foreman_hooks` without creating payloads for each individual webhook script.
However, the webhooks plugin comes with several example payload templates. You can use the example payloads with shellhooks to simplify migration.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
However, the webhooks plugin comes with several example payload templates. You can use the example payloads with shellhooks to simplify migration.
However, the webhooks plugin comes with several example payload templates.
You can use the example payloads with shellhooks to simplify migration.

@@ -0,0 +1,17 @@
[id="shellhooks_{context}"]
= Shellhooks usage details
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
= Shellhooks usage details
= Shellhooks Usage Details

[id="shellhooks_{context}"]
= Shellhooks usage details

You can install a {SmartProxy} Shellhooks that expose executables using a REST HTTPS API.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean "shellhooks plugin"?

@melcorr
Copy link
Member

melcorr commented Aug 12, 2021

Feel free to reopen this at any time!
Thanks

@melcorr melcorr closed this Aug 12, 2021
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.

None yet

4 participants