# US 2021/0232492 A1 · History based build cache for program builds

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0232492 A1
- Document ID: US20210232492A1
- Status: Published application
- Kind: A1
- Application number: 16/773,457
- Filed: 2020-01-27
- Published: 2021-07-29
- Earliest claimed: 2020-01-27
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Michael Tsirkin
- Web page: https://patentgrep.com/patent/US20210232492A1

## CPC

- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 21/57: Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 11/3692: {for test results analysis}
- G06F 11/3696: {Methods or tools to render software testable}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 11/3404: {for parallel or distributed programming}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 21/121: {Restricting unauthorised execution of programs}
- G06F 21/554: {involving event detection and direct action}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system includes a memory storing program versions in a program history and a processor in communication with the memory. The processor is configured to store program components of a version of a program in a first directory associated with the version and select first and second candidate versions of the program from the program history to compare to a test version of the program. The processor is also configured to compare the first and second candidate versions to the test version, estimate an amount of work to regenerate the program from each of the candidate versions, and select the candidate version associated with a lesser amount of work. Additionally, the processor is configured to regenerate the program using components from the selected candidate version to create a regenerated program, store components of the regenerated program in a second directory associated with test version, and test the regenerated program.

## Claims

### Claim 1

A system comprising:
a memory storing a plurality of versions of a program in a program history; and
a processor in communication with the memory configured to:
store program components of a version of the program in a first directory associated with the version,
select a first candidate version of the program and a second candidate version of the program from the program history to compare to a test version of the program,
compare (i) the first candidate version to the test version and (ii) the second candidate version to the test version,
estimate an amount of work to regenerate the program from each of the first candidate version and the second candidate version,
select the first candidate version, wherein the first candidate version is associated with a lesser amount of work to regenerate the program than the second candidate version,
regenerate the program using components from the first candidate version to create a regenerated program,
store components of the regenerated program in a second directory associated with test version, and
test the regenerated program.

### Claim 2 (depends on 1)

The system of claim 1, wherein the memory is network storage that includes the first directory and the second directory.

### Claim 3 (depends on 1)

The system of claim 1, wherein an index of each version of the plurality of versions of the program is based on an entire respective version of the program, and wherein a git commit hash of the version of the program is calculated for the index.

### Claim 4 (depends on 1)

The system of claim 1, wherein the first candidate version and the second candidate version are the two respective versions that are positioned closest to the test version in the program history.

### Claim 5 (depends on 1)

The system of claim 1, wherein when comparing (i) the first candidate version to the test version, the processor is further configured to:
compare a first list of source files associated with the first candidate version to a second list of source files associated with the test version, and
generate a third list of source files that includes respective source files that differ between the first list and the second list.

### Claim 6 (depends on 5)

The system of claim 5, wherein estimating the amount of work to regenerate the program includes one of (i) determining a quantity of source files that differ between the first list and the second list, (ii) determining a cumulative size of each file in the third list, and (iii) determining a work estimate based on (i) and (ii).

### Claim 7 (depends on 5)

The system of claim 5, wherein when regenerating the program, the processor is configured to:
generate a first list of source files that differ between the first candidate version and the test version,
generate a second list of source files that are the same between the first candidate version and the test version,
set a first time stamp for each respective file on the first list of source files to a current time, and
set a second time stamp for each respective file on the second list of source files to an original time.

### Claim 8

A method comprising:
storing program components of a version of a program in a first directory associated with the version;
selecting a first candidate version of the program and a second candidate version of the program, from a plurality of versions of the program in a program history, to compare to a test version of the program;
comparing (i) the first candidate version to the test version and (ii) the second candidate version to the test version;
estimating an amount of work to regenerate the program from each of the first candidate version and the second candidate version;
selecting the first candidate version, wherein the first candidate version is associated with a lesser amount of work to regenerate the program than the second candidate version;
regenerating the program using components from the first candidate version to create a regenerated program;
storing components of the regenerated program in a second directory associated with test version; and
testing the regenerated program.

### Claim 9 (depends on 8)

The method of claim 8, wherein program components are components of a binary and are stored in network storage.

### Claim 10 (depends on 8)

The method of claim 8, wherein the version of the program is built in a cloud environment.

### Claim 11 (depends on 8)

The method of claim 8, wherein an index of each version of the plurality of versions of the program is based on an entire respective version of the program, and wherein a git commit hash of the version of the program is calculated for the index.

### Claim 12 (depends on 8)

The method of claim 8, wherein the plurality of versions of the program are organized in the program history, and the first candidate program version and the second candidate program version are the two respective versions that are positioned closest to the test version in the program history.

### Claim 13 (depends on 8)

The method of claim 8, wherein comparing the first candidate version to the test version includes comparing a first list of source files associated with the first candidate version to a second list of source files associated with the test version and generating a third list of source files that includes respective source files that differ between the first list and the second list.

### Claim 14 (depends on 13)

The method of claim 13, wherein estimating the amount of work to regenerate the program includes one of (i) determining a quantity of source files that differ between the first list and the second list, (ii) determining a cumulative size of each file in the third list, and (iii) determining a work estimate based on (i) and (ii).

### Claim 15 (depends on 8)

The method of claim 8 further comprising building the test program.

### Claim 16 (depends on 8)

The method of claim 8, wherein regenerating the program includes:
generating a first list of source files that differ between the first candidate version and the test version;
generating a second list of source files that are the same between the first candidate version and the test version;
setting a first time stamp for each respective file on the first list of source files to a current time; and
setting a second time stamp for each respective file on the second list of source files to an original time.

### Claim 17

A non-transitory machine-readable medium storing code, which when executed by a processor is configured to:
store program components of a version of a program in a first directory associated with the version,
select a first candidate version of the program and a second candidate version of the program, from a plurality of versions of the program in a program history, to compare to a test version of the program,
compare (i) the first candidate version to the test version and (ii) the second candidate version to the test version,
estimate an amount of work to regenerate the program from each of the first candidate version and the second candidate version,
select the first candidate version, wherein the first candidate version is associated with a lesser amount of work to regenerate the program than the second candidate version,
regenerate the program using components from the first candidate version to create a regenerated program,
store components of the regenerated program in a second directory associated with test version, and
test the regenerated program.

### Claim 18 (depends on 17)

The non-transitory machine-readable medium of claim 17, wherein the first directory and the second directory are located in network storage.

### Claim 19 (depends on 17)

The non-transitory machine-readable medium of claim 17, wherein when comparing (i) the first candidate version to the test version, the processor is further configured to:
compare a first list of source files associated with the first candidate version to a second list of source files associated with the test version, and
generate a third list of source files that includes respective source files that differ between the first list and the second list.

### Claim 20 (depends on 19)

The non-transitory machine-readable medium of claim 19, wherein estimating the amount of work to regenerate the program includes one of (i) determining a quantity of source files that differ between the first list and the second list, (ii) determining a cumulative size of each file in the third list, and (iii) determining a work estimate based on (i) and (ii).
