debian-forge-composer/internal
Brian C. Lane 55325a8549 weldr: Add API v1 support to source listing
This is the first patch in a series to add APIv1 support to the
/projects/source routes. The change involves using the store.Sources key
in a different way (as an id instead of as a duplicate of the struct's
Name field) but does not actually involve changing the Sources json in
the store.

In the V0 API the name of the source was used as the identifier, and
there was no short id. In V1 the source is identified by the API using
a short id, and the Name is just a field in the struct to describe the
source. This will become more obvious with the /projects/source/info
response.

This commit changes the following:

Changes store.ListSources to ListSourcesByName and explicitly pulls the
name from the source struct instead of the key. v0 will use this
function call.

Adds store.ListSourcesById which returns the source key as the
identifier. This is used by v1.

Adds a new weldr.SourcesListV1 response type, even though it is exactly
the same as the V1 response in this specific case. I thought it would be
better to have one called V1 than to reuse the V0 struct and possibly
confuse people.

The /projects/source/list API now lists the sources by name for v0 and id for v1.

A test has been added. You will notice it still uses v0 to push and
delete the sources. These will be updated when the new version of the
functions are added in subsequent commits.
2020-06-03 21:24:47 +02:00
..
blueprint blueprint: DeepCopy() cannot fail 2020-05-18 11:50:15 +02:00
client weldr: Add API v1 support to source listing 2020-06-03 21:24:47 +02:00
common common/ImageType: move to the store package 2020-05-18 11:50:15 +02:00
crypt crypt_test: don't run on macOS 2020-04-09 13:21:30 +02:00
distro osbuild: change legacy type from bool to string 2020-06-03 12:29:47 +02:00
jobqueue jobqueue: allow canceling jobs 2020-05-13 16:45:09 +02:00
jsondb jsondb: Allow passing nil as document to Read() 2020-05-13 16:45:09 +02:00
mocks worker: introduce job artifact directory 2020-05-26 10:42:20 +02:00
osbuild osbuild: change legacy type from bool to string 2020-06-03 12:29:47 +02:00
rcm rpmmd/RepoConf: rename Id to Name 2020-05-28 00:23:54 +02:00
rpmmd rpmmd/FetchMedata: fix checksum map 2020-05-28 00:23:54 +02:00
store weldr: Add API v1 support to source listing 2020-06-03 21:24:47 +02:00
target store: move queue out of the store 2020-05-08 14:53:00 +02:00
test test/helper: add comparison for ImageType objects 2020-05-18 11:50:15 +02:00
upload Add basic logging to AWS upload process 2020-06-03 21:02:58 +02:00
weldr weldr: Add API v1 support to source listing 2020-06-03 21:24:47 +02:00
worker distro: make the osbuild package internal to the distros 2020-06-03 00:30:01 +02:00