Skip to content

Commit d1deeb3

Browse files
partoufclaude
andcommitted
Add /clearbuildstatusforlibrary endpoint to clear build failures by library
Adds a new authenticated POST endpoint that deletes build failure records for a given library, with optional version filtering. Includes the database method, route handler, and API documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4e5afd1 commit d1deeb3

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

build-logging.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,31 @@ class BuildLogging {
6565
await stmt.run();
6666
}
6767

68+
async clearBuildStatusForLibrary(library, library_version) {
69+
let query;
70+
let params;
71+
72+
if (library_version) {
73+
query = `delete from latest
74+
where library=@library
75+
and library_version=@library_version`;
76+
params = {
77+
'@library': library,
78+
'@library_version': library_version
79+
};
80+
} else {
81+
query = `delete from latest
82+
where library=@library`;
83+
params = {
84+
'@library': library
85+
};
86+
}
87+
88+
const stmt = await this.connection.prepare(query);
89+
await stmt.bind(params);
90+
await stmt.run();
91+
}
92+
6893
async setBuildFailed(library, library_version, compiler, compiler_version, arch, libcxx, compiler_flags, logging, commithash) {
6994
const now = this.getCurrentDateStr();
7095

docs/api.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,23 @@ Payload example:
186186
"compiler_version": "g101"
187187
}
188188
```
189+
190+
191+
### POST `/clearbuildstatusforlibrary`
192+
193+
Clear build failure status for a library so builds will be re-attempted. Optionally filter by version.
194+
195+
Payload example (clear all versions):
196+
```
197+
{
198+
"library": "fmt"
199+
}
200+
```
201+
202+
Payload example (clear specific version):
203+
```
204+
{
205+
"library": "fmt",
206+
"library_version": "10.0.0"
207+
}
208+
```

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,14 @@ function main() {
609609
);
610610
res.send("OK");
611611
})
612+
.post('/clearbuildstatusforlibrary', nocache, async (req, res) => {
613+
const data = req.body;
614+
buildlogging.clearBuildStatusForLibrary(
615+
data.library,
616+
data.library_version
617+
);
618+
res.send("OK");
619+
})
612620
.get('/compilerfailurerates', expireshourly, async (req, res) => {
613621
const failurerates = await buildlogging.getCompilerFailureRates();
614622
res.send(failurerates);

0 commit comments

Comments
 (0)