Skip to content

Commit

Permalink
feat: Add testing workflow
Browse files Browse the repository at this point in the history
- feat: Add testing workflow
- cleanup: Minor fixes
  • Loading branch information
matbme authored Nov 27, 2023
2 parents a001343 + 697da0d commit 2099b85
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
22 changes: 22 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Go

on:
push:
branches: [ "main" ]
pull_request_target:
branches: [ "main" ]
types: [opened, synchronize, reopened]

jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Build
run: make
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ differ:
.PHONY: clean

clean:
rm -f differ
rm -f differ
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Differ

Differ is a REST-API for retrieving package changes between immages on immutable Linux distributions.
Differ is a REST-API for retrieving package changes between images on immutable Linux distributions.
It was designed for allowing the user to visualize changes in package versions in [Vanilla OS](https://vanillaos.org), but this tool can be used by any distribution without any changes to the code.

## Build and Setup
Expand Down Expand Up @@ -33,7 +33,7 @@ When setting up Differ in production, you must `export GIN_MODE=release` before
## Endpoints
#### Status
### Status
Simple check to see if the server is running correctly.
Expand Down Expand Up @@ -63,13 +63,14 @@ Creates a new image in the dabatase. Every release (see subsection below) is att
*Endpoint:* `http://[base_url]/images/new`
*Parameters:*
- *Name:* Image name
- *URL:* Where the image is hosted or its repository. For information purposes only.
```json
{
"name": "pico",
"url": "https://github.com/Vanilla-OS/pico-image"
"name": "pico",
"url": "https://github.com/Vanilla-OS/pico-image"
}
```
Expand All @@ -93,7 +94,7 @@ Retrieves information about an image given its name.
{
"image": {
"name": "pico",
"url": "https://github.com/Vanilla-OS/pico-image",
"url": "https://github.com/Vanilla-OS/pico-image",
"releases": [
...
]
Expand Down Expand Up @@ -147,13 +148,14 @@ Creates a new release for the given image.
*Endpoint:*`http://[base_url]/images/[image]/new`
*Parameters:*
- *Digest:* Image digest
- *Packages:* List of package names and versions in the current release. `get_all_packages.py` contains a script for extracting the list from a Debian-based distribution.
```json
{
"digest": "sha256:a99e4593b23fd07e3761639e9db38c0315e198d6e39dad6070e0e0e88be3de0d",
"packages": [
"digest": "sha256:a99e4593b23fd07e3761639e9db38c0315e198d6e39dad6070e0e0e88be3de0d",
"packages": [
{
"name": "apt",
"version": "2.7.3"
Expand Down Expand Up @@ -224,6 +226,7 @@ The most important endpoint in the API. Given two digests, generates a list of c
*Endpoint:* `http://[base_url]/images/[image]/diff`
*Parameters:*
- *Old digest:* Digest of the older image, which is usually the image the user is currently on.
- *New digest:* Digest of the newer image, which is usually the image the user wants to update to.
Expand Down Expand Up @@ -270,4 +273,4 @@ The most important endpoint in the API. Given two digests, generates a list of c
}
```
- `400 Bad Request` if either digest cannot be found.
- `400 Bad Request` if either digest cannot be found.

0 comments on commit 2099b85

Please sign in to comment.