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

AutoOpenInactive bugfix and action prepare return values #361

Open
wants to merge 2 commits into
base: 5.0-trunk
Choose a base branch
from

Conversation

NReilingh
Copy link
Contributor

This PR originated as an unexpected behavior on my production RT instance. I noticed that tickets were being moved into open status unexpectedly -- for example, a new ticket that the requestor made the first reply to would be opened by the requestor's reply.

I initially thought this was a bug in AutoOpen, so I went looking through the code of it and other actions. I came across a sort of red herring -- that the Prepare guards were returning true instead of false. These actually don't have a functional effect because the Commit phase will return early if the last part of Prepare is not reached, but they do make the debug log messages more confusing since, really, Commit should never be run if Prepare fails to satisfy all of its guard clauses.

Eventually, though, I realized that AutoOpenInactive was running not just on inactive statuses (but also on initial statuses), and so it was the culprit of my "new tickets being auto-opened" problem.

I am submitting these two commits to fix the bug in AutoOpenInactive so that its behavior matches its documentation and name (only operating on tickets in an inactive status), and to clean up the Prepare blocks of three RT Actions so that the return value semantics are more correct.

As documented, this action operates on inactive statuses. The previous logic would operate on initial statuses also. AutoOpen.pm is intended to work from initial statuses.
@NReilingh
Copy link
Contributor Author

Noticed in my fork that GitHub Actions were running the test suite and failing a bunch of tests. Pretty interesting, considering that this particular action doesn't have a test suite!

Would appreciate getting some feedback on this -- I haven't yet figured out how to build and run RT from source in development mode yet (though I would like to), but I know that there is a docker harness for running the test suite at least.

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.

1 participant