ohwgiles/laminar

Docs: Drop old artifacts and build logs

jbglaw opened this issue · 3 comments

Hi!

Building lots of stuff means to generate lots of logs. During testing, I just deleted the database file and artifacts directory manually every now and then.

However, I think it would be good to move that functionality into laminarc. What do you think?

Thanks,
Jan-Benedict

  1. Since Laminar run scripts are just regular shell scripts (or anything executable), they can easily be tested on their own before having laminar execute them.
  2. Laminar is totally happy for you to hack its database (here's an example)

So all in all I am not convinced that it moving it into laminarc provides any benefit other than making it "feel" like a more first-class supported operation, at the cost of lots of boilerplate, RPC etc.

You could "add" this to laminarc by creating a job which takes another job name as a parameter and clears it out, something like the following totally untested code:

clear-history.run:

#!/bin/bash -e

if laminarc show-jobs | egrep "^$job\$"; then
  rm -rf "$ARCHIVE/../$job"
  sqlite3 "$LAMINAR_HOME/laminar.sqlite" "DELETE FROM builds WHERE name = '$job'"
fi

laminarc run clear-history job=foo

It's not that easy. From a frontend point of view, missing "builds" for example result in the "left" and "right" buttons on the log-showing page not working properly (at least with the frontend code Debian ships---though I guess Debian's small modifications aren't the root cause.)

Ok makes sense, the latest build numbers are cached in laminar itself, it would need to be restarted after the database is cleaned.

Anyway for me this is not a feature that laminar needs, and I'm not interested in implementing it.

That being said, I would consider merging a well-written patch that implements this, especially if other users express an interest in this.