hercules-ci / support

User feedback, questions and our public roadmap. help@hercules-ci.com
5 stars 1 forks source link

Add git revision to the agent status page #56

Open jappeace opened 3 years ago

jappeace commented 3 years ago

In another discussion, it wasn't enough to show the version. I think future discussions would go faster if the git revision would be available on the status page. I mean this page:

image

In Haskell, it's quite easy to do with GitHash Although that does trash nix caching on every commit, which isn't ideal.

jappeace commented 3 years ago

As a workaround I did this:

let 
    agent-revision = "https://github.com/hercules-ci/hercules-ci-agent/archive/7fc025e183f22a21360b550dc0d0e15a5c1a3122.tar.gz";
    hercules-ci-agent = fetchTarball agent-revision;
in
{
      agent = { pkgs, ... }: {
         environment.etc.agent-version = {
              text = agent-revision;
              mode = "0440";
          };
        ....
    };
 };

Next time I'll know what's running there.

roberth commented 2 years ago

I've since updated the modules to get revision information from various sources and put it in a user data field called "Labels".

Both Nixpkgs-based installations and Flake-based installations will show version metadata when you click the agent, leading to a new page.

You can add any TOML-serializable value to services.hercules-ci-agent.settings.labels. This includes most of JSON.

Here's an example of the default label set by a flake.

Screenshot from 2022-01-14 18-32-17