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

gaby: record actions #9

Open
jba opened this issue Aug 26, 2024 · 0 comments
Open

gaby: record actions #9

jba opened this issue Aug 26, 2024 · 0 comments
Assignees

Comments

@jba
Copy link
Contributor

jba commented Aug 26, 2024

Keep a record of all actions performed (in a DB).

@jba jba self-assigned this Aug 26, 2024
gopherbot pushed a commit that referenced this issue Sep 13, 2024
First of a few CLs to refactor the commentfix package to separate
creating actions from executing them.

This moves the logic of what to do for an event (or whether to do
anything) into a separate method.

For #9.

Change-Id: I909b03f1e009437d4aab090821dea7edaaf8cbe4
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/612895
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Zvonimir Pavlinovic <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 13, 2024
Move executing an action into a separate function.

For #9.

Change-Id: If34e9354da22ae0b79c3bd3b1e5092615ce1e0d3
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/612935
Reviewed-by: Zvonimir Pavlinovic <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 24, 2024
The actions log was appending a random number to each key to
make sure they were unique.

The intention was to make sure that every attempt to log an action
generated a new log entry. But if we don't do that and let the user
control the key, then the action log can double as way to check if
a piece of work has been done already, and avoid doing it again.

For example, the comment fixer records whether it has fixed an issue
or comment in the DB, to avoid duplicating work. Prior to this change,
it would need to continue doing that as well as logging actions.
But as a result of this change and the upcoming CL, it won't need those
extra DB entries, because the action log will record whether the action
was done.

(The next CL will make this clearer.)

For #9.

Change-Id: Iede5df4184e6bffaa75ac7d2fdb4ece4b1fb8f0f
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/615615
Reviewed-by: Tatiana Bradley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Zvonimir Pavlinovic <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 25, 2024
Replace Before and After with Register and Run.

Register is called by components that want to use the log,
and Run should be called by the main program to run all actions.

See the top comment in actions.go for more.

For #9.

For #9.

Change-Id: Id8dea631680b28ebae98414325741453a3615dfe
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/615616
Reviewed-by: Tatiana Bradley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 26, 2024
Set up a page to display the action log.
This CL contains the controls that select a time interval.

For #9.

Change-Id: I1bd38ac42ba42631604fb07e788861da21df2735
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/616056
Reviewed-by: Tatiana Bradley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 27, 2024
Display the selected entries on the page.

Since actions may be large, put each action in a row below the
other fields of the entry, and allow the user to toggle its display.

For #9.

Change-Id: I8c8c97c2e808e2dcf94e47e9b8b4adf72ba21ee7
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/616217
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Tatiana Bradley <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 27, 2024
Also do some other minor improvements.

For #9.

Change-Id: I98f401b107175b0193e65e416c7ed96179914b4a
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/616275
Reviewed-by: Tatiana Bradley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Zvonimir Pavlinovic <[email protected]>
gopherbot pushed a commit that referenced this issue Oct 1, 2024
A Fixer will now write fixes to the action log.
They won't actually run until actions.Run is called, which happens
in gaby/main.go.

Also, use the action log to write better tests that don't depend
on the strings in the ordinary log.

For #9.

For #9.

Change-Id: Ifd989aa3d9dce2b1876f902a9e8be7d56c3d050e
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/616276
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Tatiana Bradley <[email protected]>
Reviewed-by: Zvonimir Pavlinovic <[email protected]>
gopherbot pushed a commit that referenced this issue Oct 1, 2024
This CL defines the action and result types and the runAction
method, and calls runAction. But it doesn't actually use the action
log.

For #9.

Change-Id: I17844859b7ef6e0cc4dbe0d1fc846ea345bb576f
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/616915
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Zvonimir Pavlinovic <[email protected]>
gopherbot pushed a commit that referenced this issue Oct 2, 2024
The action log page should display action values nicely.
We used json.MarshalIndent for that, but HTML will ignore line breaks.
A plain <pre> block observes formatting, but its width cannot be
easily controlled.

Use a <pre> block with a style attribute that wraps at whitespace
and limit the maximum table size to the window width to produce
a readable display.

For #9.

Change-Id: I4f4c5e418964bb497572c3e2979323046025f6b3
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/617435
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Tatiana Bradley <[email protected]>
Reviewed-by: Zvonimir Pavlinovic <[email protected]>
gopherbot pushed a commit that referenced this issue Oct 2, 2024
All posts of related-issue comments are first written to the action
log, and then executed at a future time (currently, the same cron
request).

Also, rewrite tests to use the action log.

For #9.

Change-Id: I1536f4b350ad76b8029dbd145edaff58726c3897
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/617295
Reviewed-by: Tatiana Bradley <[email protected]>
Reviewed-by: Zvonimir Pavlinovic <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit that referenced this issue Oct 2, 2024
Improve the display of actions on the actionlog page, and with any
future tools.

Instead of displaying the action as its original JSON, let the
component that registers with the log control the action's format.

Since there are now two functions to register instead of just one,
use an interface.

The main display change in this CL is the use of a diff for comment
fixers, rendering the changes clearer.

For #9.

Change-Id: I39bf91aac741595f3833f5b132ddfdc13c25672b
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/617436
Reviewed-by: Zvonimir Pavlinovic <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
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

No branches or pull requests

1 participant