Skip to content

Improve chatops messages - #285

Merged
dhollinger merged 1 commit into
voxpupuli:masterfrom
markeganfuller:improve_chatops_messages
Oct 26, 2026
Merged

dhollinger merged 1 commit into
voxpupuli:masterfrom
markeganfuller:improve_chatops_messages

Conversation

@markeganfuller

Copy link
Copy Markdown
Contributor

Currently you get the same message twice if you're using queues, adjust the second message to actually state the job is done.

Additionally add the hostname to the author so we can see which server has been deployed to.

@markeganfuller
markeganfuller force-pushed the improve_chatops_messages branch from 2eb4eef to 76665da Compare October 19, 2026 12:35
Comment thread lib/queue/queue.go Outdated
}

conn.PostMessage(http.StatusAccepted, job.Name, res)
conn.PostMessage(http.StatusCreated, job.Name, res)

@marcusdots marcusdots Oct 19, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What does it look like to a user?
After this message a job gets Marked as done, so any positive HTTP status could would suffice. I do not see any reason to prefer StatusAccepted over StatusCreated.
I do not even understand why we would prefer a message on creation than a message on finishing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The way the current chatops implementation works is messages are based off the status code, so we need to use a different status code from the existing 'job accepted' state if we want a different message.

Since this message is a 'job done' state I went with 201 Created, but as long as its not 202 any 2XX would work.

Messages before changes:

r10k for Puppet
r10k deployment of Puppet environment XXX
Successfully started deployment of XXX
---
r10k for Puppet
r10k deployment of Puppet environment XXX
Successfully started deployment of XXX

Messages after changes:

r10k for Puppet on examplehost
r10k deployment of Puppet environment XXX
Successfully started deployment of XXX
---
r10k for Puppet on examplehost
r10k deployment of Puppet environment XXX
Successfully deployed XXX

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would like to add the meaning of HTTP status codes:
Accepted is supposed to signal "creation of resource has begun" and Created is supposed to signal "creation of resource finished".

marcusdots
marcusdots previously approved these changes Oct 19, 2026
TheMeier
TheMeier previously approved these changes Oct 19, 2026
dhollinger
dhollinger previously approved these changes Oct 26, 2026
* Include hostname
* Print a different message on success vs queued
@dhollinger
dhollinger merged commit 155496e into voxpupuli:master Oct 26, 2026
1 check passed
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.

4 participants