Compare commits
16 Commits
feat/disab
...
feat/disab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d288e401ba | ||
|
|
41daeb3cc9 | ||
|
|
3b1b5009f3 | ||
|
|
54699ae671 | ||
|
|
503871bac4 | ||
|
|
6dde18cb5e | ||
|
|
e0f65d4d3d | ||
|
|
5e2e9672cf | ||
|
|
650871b586 | ||
|
|
b2030cd4ef | ||
|
|
44780c786e | ||
|
|
b88b06dd3c | ||
|
|
f1b26134d7 | ||
|
|
23fa93c5f8 | ||
|
|
66730993fc | ||
|
|
25d1e8900a |
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
runner: ubuntu-24.04-arm
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: cachix/install-nix-action@v31
|
||||
|
||||
4
.github/workflows/update-flakes.yml
vendored
4
.github/workflows/update-flakes.yml
vendored
@@ -11,12 +11,12 @@ jobs:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
- name: Update flake inputs
|
||||
run: nix flake update
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
uses: peter-evans/create-pull-request@v8
|
||||
with:
|
||||
commit-message: "flake.lock: Update"
|
||||
title: "Update flake inputs"
|
||||
|
||||
125
hydra-api.yaml
125
hydra-api.yaml
@@ -574,6 +574,131 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobsetEvalBuilds'
|
||||
|
||||
/jobset/{project-id}/{jobset-id}/latest-eval:
|
||||
get:
|
||||
summary: Redirects to the latest finished evaluation for a jobset
|
||||
parameters:
|
||||
- name: project-id
|
||||
in: path
|
||||
description: project identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: jobset-id
|
||||
in: path
|
||||
description: jobset identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'302':
|
||||
description: the evaluation to redirect to
|
||||
headers:
|
||||
Location:
|
||||
example: /eval/1?name={jobset-id}
|
||||
schema:
|
||||
type: string
|
||||
|
||||
/job/{project-id}/{jobset-id}/{job-id}/latest:
|
||||
get:
|
||||
summary: Redirects to the latest succesful build for a job
|
||||
parameters:
|
||||
- name: project-id
|
||||
in: path
|
||||
description: project identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: jobset-id
|
||||
in: path
|
||||
description: jobset identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: job-id
|
||||
in: path
|
||||
description: job identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'302':
|
||||
description: the build to redirect to
|
||||
headers:
|
||||
Location:
|
||||
example: /build/1
|
||||
schema:
|
||||
type: string
|
||||
|
||||
/job/{project-id}/{jobset-id}/{job-id}/latest-for/{system}:
|
||||
get:
|
||||
summary: Redirects to the latest succesful build for a job
|
||||
parameters:
|
||||
- name: project-id
|
||||
in: path
|
||||
description: project identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: jobset-id
|
||||
in: path
|
||||
description: jobset identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: job-id
|
||||
in: path
|
||||
description: job identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: system
|
||||
in: path
|
||||
description: system
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
example: x86_64-linux
|
||||
responses:
|
||||
'302':
|
||||
description: the build to redirect to
|
||||
headers:
|
||||
Location:
|
||||
example: /build/1
|
||||
schema:
|
||||
type: string
|
||||
|
||||
/job/{project-id}/{jobset-id}/{job-id}/latest-finished:
|
||||
get:
|
||||
summary: Redirects to the latest succesful build for a job from a finished evaluation
|
||||
parameters:
|
||||
- name: project-id
|
||||
in: path
|
||||
description: project identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: jobset-id
|
||||
in: path
|
||||
description: jobset identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: job-id
|
||||
in: path
|
||||
description: job identifier
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'302':
|
||||
description: the build to redirect to
|
||||
headers:
|
||||
Location:
|
||||
example: /build/1
|
||||
schema:
|
||||
type: string
|
||||
|
||||
components:
|
||||
schemas:
|
||||
|
||||
|
||||
@@ -220,11 +220,11 @@ sub scmdiff : Path('/api/scmdiff') Args(0) {
|
||||
my $clonePath = getSCMCacheDir . "/git/" . sha256_hex($uri);
|
||||
die if ! -d $clonePath;
|
||||
my ($stdout1, $stderr1);
|
||||
run3(['git', '-C', $clonePath, 'log', "$rev1..$rev2"], \undef, \$stdout1, \$stderr1);
|
||||
run3(['git', '--git-dir', '.git', '-C', $clonePath, 'log', "$rev1..$rev2"], \undef, \$stdout1, \$stderr1);
|
||||
$diff .= $stdout1 if $? == 0;
|
||||
|
||||
my ($stdout2, $stderr2);
|
||||
run3(['git', '-C', $clonePath, 'diff', "$rev1..$rev2"], \undef, \$stdout2, \$stderr2);
|
||||
run3(['git', '--git-dir', '.git', '-C', $clonePath, 'diff', "$rev1..$rev2"], \undef, \$stdout2, \$stderr2);
|
||||
$diff .= $stdout2 if $? == 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -495,6 +495,9 @@ sub steps :Local Args(0) {
|
||||
|
||||
sub search :Local Args(0) {
|
||||
my ($self, $c) = @_;
|
||||
|
||||
badRequest($c, "Search is disabled in this Hydra instance") if $c->config->{disable_search};
|
||||
|
||||
$c->stash->{template} = 'search.tt';
|
||||
|
||||
my $query = trim $c->request->params->{"query"};
|
||||
|
||||
@@ -12,19 +12,31 @@ sub supportedInputTypes {
|
||||
$inputTypes->{'path'} = 'Local path or URL';
|
||||
}
|
||||
|
||||
sub _parseValue {
|
||||
# The input is a local path or URL, optionally followed by a
|
||||
# time period specified in seconds.
|
||||
my ($config, $value) = @_;
|
||||
my @parts = split ' ', $value;
|
||||
(my $uri, my $freq) = @parts;
|
||||
# By default don't check a path more often than every 30 seconds,
|
||||
# but the second path argument can change that value or the global
|
||||
# path_input_cache_validity_seconds configuration, in that order.
|
||||
my $timeout = defined $freq ? $freq : ($config->{path_input_cache_validity_seconds} // 30);
|
||||
|
||||
return ($uri, $timeout);
|
||||
}
|
||||
|
||||
sub fetchInput {
|
||||
my ($self, $type, $name, $value) = @_;
|
||||
|
||||
return undef if $type ne "path";
|
||||
|
||||
my $uri = $value;
|
||||
my ($uri, $timeout) = _parseValue($self->{config}, $value);
|
||||
|
||||
my $timestamp = time;
|
||||
my $sha256;
|
||||
my $storePath;
|
||||
|
||||
my $timeout = $self->{config}->{path_input_cache_validity_seconds} // 30;
|
||||
|
||||
# Some simple caching: don't check a path more than once every N seconds.
|
||||
(my $cachedInput) = $self->{db}->resultset('CachedPathInputs')->search(
|
||||
{srcpath => $uri, lastseen => {">", $timestamp - $timeout}},
|
||||
|
||||
@@ -347,13 +347,23 @@ BLOCK renderDiffUri;
|
||||
url = res.0;
|
||||
branch = res.1;
|
||||
IF bi1.type == "hg" || bi1.type == "git" %]
|
||||
<a target="_blank" [% HTML.attributes(href => c.uri_for('/api/scmdiff', {
|
||||
uri = url,
|
||||
rev1 = bi1.revision,
|
||||
rev2 = bi2.revision,
|
||||
type = bi1.type,
|
||||
branch = branch
|
||||
})) %]>[% HTML.escape(contents) %]</a>
|
||||
[% IF url.substr(0, 19) == "https://github.com/" %]
|
||||
<a target="_blank" [% HTML.attributes(href =>
|
||||
url
|
||||
_ "/compare/"
|
||||
_ bi1.revision
|
||||
_ "..."
|
||||
_ bi2.revision,
|
||||
) %]>[% HTML.escape(contents) %]</a>
|
||||
[% ELSE %]
|
||||
<a target="_blank" [% HTML.attributes(href => c.uri_for('/api/scmdiff', {
|
||||
uri = url,
|
||||
rev1 = bi1.revision,
|
||||
rev2 = bi2.revision,
|
||||
type = bi1.type,
|
||||
branch = branch
|
||||
})) %]>[% HTML.escape(contents) %]</a>
|
||||
[% END %]
|
||||
[% ELSE;
|
||||
contents;
|
||||
END;
|
||||
|
||||
@@ -121,9 +121,11 @@
|
||||
[% END %]
|
||||
|
||||
[% IF showPrivate %]
|
||||
<form class="form-inline" action="[% c.uri_for('/search') %]">
|
||||
<input name="query" type="text" class="form-control" placeholder="Search" [% HTML.attributes(value => c.req.params.query) %]/>
|
||||
</form>
|
||||
[% UNLESS c.config.disable_search %]
|
||||
<form class="form-inline" action="[% c.uri_for('/search') %]">
|
||||
<input name="query" type="text" class="form-control" placeholder="Search" [% HTML.attributes(value => c.req.params.query) %]/>
|
||||
</form>
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
<ul class="navbar-nav">
|
||||
|
||||
Reference in New Issue
Block a user