You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To show the current build status on the repos page it is necessary to have some basic information about the latest build of each repo. While it would generally be possible to retrieve this info using the GET /api/repos/<owner>/<repo>/builds endpoint this would lead to a unnecessarily large number of requests. Therefore I propose to directly add this data to GET /api/user/repos. I can currently think of these options to do so:
alternatively this could be the last build on the default barnch (usually master or main)
add an array of the latest builds for each branch:
[
{
"id": 5,
"owner": "test",
"name": "123",
"full_name": "test/123",
"link_url": "https://git.example.com/test/123",
// new:"last_builds": [
{
"id": 107,
"number": 19,
"author": "test",
"event": "push",
"status": "success",
"enqueued_at": 1643933634,
"created_at": 1643933634,
"started_at": 1643938125,
"finished_at": 1643939241,
"commit": "7fe7b02400c1c598a3f49b65c5693e4e41554056",
"branch": "main", // dafault branch"message": "commit message",
"timestamp": 1643933633,
"author_avatar": "https://git.example.com/avatars/fa93386cdc60183ae3a861c45170bc6a",
"link_url": "https://git.piored.de/vidre/transcoding-server/commit/7fe7b02400c1c598a3f49b65c5693e4e41554056",
"changed_files": [
"testfile-1"
],
...
},
// if option 5 is chosen, this is only included if the last build was not on the default branch
{
"id": 107,
"number": 19,
"author": "test",
"event": "push",
"status": "success",
"enqueued_at": 1643933634,
"created_at": 1643933634,
"started_at": 1643938125,
"finished_at": 1643939241,
"commit": "a6e350241cc1c598ada90b65cee8f3e4e41abf3f7",
"branch": "new-feature-branch", // some branch other than the default `main`"message": "commit message",
"timestamp": 1643933633,
"author_avatar": "https://git.example.com/avatars/fa93386cdc60183ae3a861c45170bc6a",
"link_url": "https://git.piored.de/vidre/transcoding-server/commit/7fe7b02400c1c598a3f49b65c5693e4e41554056",
"changed_files": [
"testfile-2"
],
...
},
...},...
]
a map with the branch as key could be used instead of an array:
[
{
"id": 5,
"owner": "test",
"name": "123",
"full_name": "test/123",
"link_url": "https://git.example.com/test/123",
// new:"last_builds": {
"main": { // default branch"id": 107,
"number": 19,
"author": "test",
"event": "push",
"status": "success",
"enqueued_at": 1643933634,
"created_at": 1643933634,
"started_at": 1643938125,
"finished_at": 1643939241,
"commit": "7fe7b02400c1c598a3f49b65c5693e4e41554056",
"branch": "main", // dafault branch"message": "commit message",
"timestamp": 1643933633,
"author_avatar": "https://git.example.com/avatars/fa93386cdc60183ae3a861c45170bc6a",
"link_url": "https://git.piored.de/vidre/transcoding-server/commit/7fe7b02400c1c598a3f49b65c5693e4e41554056",
"changed_files": [
"testfile-1"
],
...
},
// if option 5 is chosen, this is only included if the last build was not on the default branch"new-feature-branch": { // some branch other than the default `main`"id": 107,
"number": 19,
"author": "test",
"event": "push",
"status": "success",
"enqueued_at": 1643933634,
"created_at": 1643933634,
"started_at": 1643938125,
"finished_at": 1643939241,
"commit": "a6e350241cc1c598ada90b65cee8f3e4e41abf3f7",
"branch": "new-feature-branch", // some branch other than the default `main`"message": "commit message",
"timestamp": 1643933633,
"author_avatar": "https://git.example.com/avatars/fa93386cdc60183ae3a861c45170bc6a",
"link_url": "https://git.piored.de/vidre/transcoding-server/commit/7fe7b02400c1c598a3f49b65c5693e4e41554056",
"changed_files": [
"testfile-2"
],
...
},
...
},
...]
Instead of including the latest build status for every branch it would also be possible to only include the info for the default branch and if applicable the latest build on a non-default branch. This could reduce data usage for repos with many branches.
Options 3, 4 and 5 would allow users to select in the settings if they want to see the status of the latest build or the latest build on the default branch (master or main).
The text was updated successfully, but these errors were encountered:
nitn3lav
changed the title
[API] /api/repos/<owner>/<repo>/builds include last build status
[API] /api/repos include last build status
Feb 4, 2022
nitn3lav
changed the title
[API] /api/repos include last build status
[API] /api/user/repos include last build status
Feb 4, 2022
To show the current build status on the repos page it is necessary to have some basic information about the latest build of each repo. While it would generally be possible to retrieve this info using the
GET /api/repos/<owner>/<repo>/builds
endpoint this would lead to a unnecessarily large number of requests. Therefore I propose to directly add this data toGET /api/user/repos
. I can currently think of these options to do so:alternatively this could be the last build on the default barnch (usually
master
ormain
)add an array of the latest builds for each branch:
Options 3, 4 and 5 would allow users to select in the settings if they want to see the status of the latest build or the latest build on the default branch (
master
ormain
).The text was updated successfully, but these errors were encountered: