NixOS / NixOS/hydra

Add a `tag` column to `cachedgitinputs`

Open
#690 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PLpgSQL
Stars
1.6k
Forks
358
Avg merge
20h 30m
Merged PRs (30d)
27

Description

Currently when you first push new commits to a branch the nix-prefetch-git call will be cached in the cachedgitinputs table:

hydra=> \d cachedgitinputs
Table "public.cachedgitinputs"
   Column   | Type | Modifiers
------------+------+-----------
 uri        | text | not null
 branch     | text | not null
 revision   | text | not null
 sha256hash | text | not null
 storepath  | text | not null
Indexes:
    "cachedgitinputs_pkey" PRIMARY KEY, btree (uri, branch, revision)
    "indexcachedgitinputsonhash" btree (uri, branch, sha256hash)

However when you then push a new annotated git tag the GitInput plugin will consider the input cached because it only looks at the uri, branch and revision. Therefor no new nix-prefetch-git will be performed causing git describe --always, which retrieves the git tag, to return the old value. This means that the GitInput plugin will then return the same result as before causing no new evaliation to happen.

This is unfortunate if you have jobs that depend on the gitTag.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the cachedgitinputs table definition and the GitInput plugin around the linked line 237, then trace how uri, branch, and revision determine cache hits. Verify the behavior when a new annotated tag is pushed, and consider the schema and plugin changes needed so the tag is part of cache identity and a new evaluation occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.