8786636f7c
Four issues from the review of the initial repospawner service, none of which change the shape of a request or the file terraform-git receives. - Encode status checks as one --check flag per context on the server-to-job hop, so a separator inside a context can no longer turn one context into several; ban commas (and cap lengths) in Validate as well, since a real context never holds one. - Fail a merged request that has waited five minutes for a Woodpecker token that vanished after acceptance, surfacing "woodpecker token unavailable" through the API, instead of warning in the log forever from enabling-ci. Advance now leaves a terminal request alone so the failure sticks. - Hold a per-name lock from the duplicate checks through the store write, so two concurrent submissions of one name cannot both be accepted. - Cap the description at 500 characters and the status checks at 20 contexts of 100 characters each, and mirror the first two caps in the form.
83 lines
3.1 KiB
HTML
83 lines
3.1 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>repospawner</title>
|
|
<link rel="stylesheet" href="app.css">
|
|
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='90'%3E%F0%9F%93%A6%3C/text%3E%3C/svg%3E">
|
|
</head>
|
|
<body>
|
|
<nav class="navbar">
|
|
<div class="container navbar-inner">
|
|
<span class="brand">repospawner</span>
|
|
<span class="brand-tag">new repositories, via terraform-git pull requests</span>
|
|
</div>
|
|
</nav>
|
|
|
|
<main class="container">
|
|
<section class="panel">
|
|
<div class="panel-heading"><h2>New repository</h2></div>
|
|
<div class="panel-body">
|
|
<form id="new-form" novalidate>
|
|
<div class="form-group">
|
|
<label for="f-name">Name</label>
|
|
<input class="form-control" id="f-name" name="name" autocomplete="off"
|
|
spellcheck="false" maxlength="40" placeholder="my-service">
|
|
<p class="help">Lowercase letters, digits and dashes.</p>
|
|
<p class="field-error hidden" id="e-name"></p>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="f-description">Description</label>
|
|
<input class="form-control" id="f-description" name="description" autocomplete="off"
|
|
maxlength="500" placeholder="What the repository is for">
|
|
<p class="field-error hidden" id="e-description"></p>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="f-checks">Required status checks</label>
|
|
<textarea class="form-control" id="f-checks" name="status_checks" rows="4"
|
|
spellcheck="false">ci/woodpecker/pr/build
|
|
ci/woodpecker/pr/test
|
|
ci/woodpecker/pr/pre-commit</textarea>
|
|
<p class="help">One context per line; these gate merges into <code>main</code>.</p>
|
|
<p class="field-error hidden" id="e-status_checks"></p>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="check"><input type="checkbox" id="f-woodpecker"> Enable in Woodpecker after the PR merges</label>
|
|
<p class="help hidden" id="wp-unavailable">No Woodpecker token is mounted, so enablement is unavailable.</p>
|
|
</div>
|
|
|
|
<button class="btn btn-primary" id="submit" type="submit">Request repository</button>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<div class="panel-heading">
|
|
<h2>Requests</h2>
|
|
<span class="muted" id="refreshed"></span>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div class="table-wrap">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th><th>State</th><th>Pull request</th><th>Woodpecker</th><th>Age</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="rows"></tbody>
|
|
</table>
|
|
</div>
|
|
<p class="muted hidden" id="empty">No requests yet.</p>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
|
|
<div id="toast" class="toast hidden"></div>
|
|
<script src="app.js"></script>
|
|
</body>
|
|
</html>
|