Commit graph

57 commits

Author SHA1 Message Date
Lars Karlitski
4f2ac6a687 tree-wide: format code with gofmt 2020-02-17 16:09:17 +01:00
Martin Sehnoutka
62d186cd1b common: refactor build states into a separate file
These states will be used for tracking the image builds and compose
states in the rest of our codebase. There should be no change in the
behavior. It is a 1 to 1 replacement with the only difference of using
type alias instead of plain string.
2020-02-12 11:17:26 +01:00
Martin Sehnoutka
9c91b12076 common: compose request should include full bp and repositories
we want to move to a state where composer is a stateless service,
therefore we cannot take blueprints by name (and fetch them from a
storage) or assume repositories by the distribution. This commit
introduces both of these parameters as part of the structure.
2020-02-12 11:17:26 +01:00
Martin Sehnoutka
cffa74f0a1 common: extend common types with helper functions
It is very common that a string is required in the rest of our code and
also for user input/output. These helper functions will make this easy.
2020-02-12 11:17:26 +01:00
Ondřej Budai
a43dd00459 move ComposeResult type into common package to allow its reusing 2020-02-05 01:35:50 +01:00
Martin Sehnoutka
b0ddbc744a osbuild-pipeline: improve CLI interface
In the current state, osbuild-pipeline exits with random golang error,
such as goroutine failed, which is not at all helpful. This PR
introduces CLI arguments validation and helful error messages that use
the newly introduced types so that we don't waste time guessing what
was the right way to invoke this tool.
2020-01-30 15:17:05 +01:00
Martin Sehnoutka
8dac72f4fd internal: propose custom types for image types, arches, etc.
We currently use strings for passing arches and image types around,
which is not ideal. We should have a finite set of supported image types
and architectures as well as upload targets. This PR introduces custom
types to make the code base more readable and possibly also more
correct.

I considered some alternatives like a struct with private fields, but struct cannot
be const, so that does not help either. Eventually I think this is the "get s**t done"
solution.

The package also includes unit-tests which try to convert string to
structure and the other way around to make sure it all works properly.
2020-01-30 14:42:25 +01:00