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

Add git revision to the agent status page #56

Open
jappeace opened this issue Mar 25, 2021 · 2 comments
Open

Add git revision to the agent status page #56

jappeace opened this issue Mar 25, 2021 · 2 comments

Comments

@jappeace
Copy link

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
Copy link
Author

jappeace commented Mar 25, 2021

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
Copy link
Member

roberth commented Jan 14, 2022

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

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

2 participants