13 Commits
Author SHA1 Message Date
Reagan Lopez 0c913eec00 Refactor logging for consistent messages
Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2020-05-01 16:48:19 -07:00
Ashlesha Atrey f6dcd44f21 Implement logging for mixer
Implement the logging package for mixer.

A common log file can be set for all the mixer commands in the
builder.conf. E.g. `mixer config set Mixer.LOG <filepath>`

The log file and level can also be set for individual mixer
commands using the `--log` and `--log-level` flags respectively.

The various log levels are:
ERROR (1), WARNING (2), INFO (3), DEBUG (4) and VERBOSE (5).
Default log level is 4.

Fixes #666

Signed-off-by: Ashlesha Atrey ashlesha.atrey@intel.com
2020-04-30 13:57:58 -07:00
John Akre 8f01fe5f49 Search upstream and local bundles for deprecated list
When searching for deprecated bundles to detect bundle deletion, both
the upstream and downstream bundles must be checked. Previously,
upstream bundles were not checked during bundle deletion which prevented
downstream mixes from detecting upstream bundle deletions.

Fixes #694

Signed-off-by: John Akre <john.w.akre@intel.com>
2020-01-10 13:57:16 -08:00
Rodrigo Chiossi 01e6ca3e43 lint: Fix errors identified by golangci-lint
golangci-lint identified a couple errors that were not found by
gometalinter. This patch fixes the detected errors.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2019-09-19 16:57:37 +02:00
Rodrigo Chiossi b04762f782 cmd: skip format bump check
When doing manual format bumps, the upstream version for +20 needs to be
updated to the upstream version in the new format, but since the format
differs, the build will fail.
This PR adds a new flag to `mixer versions update` and to `mixer build`
subcommands that allows this check to be skipped.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2019-05-14 16:56:38 +02:00
John Akre 608a9dbc76 Add PREVIOUS_MIX_VERSION field to mixer.state
The mixer.state file now tracks the previous mix version with the
PREVIOUS_MIX_VERSION field. When this value is not set, it will default
to the LAST_VER or 0 when LAST_VER is invalid.

Format bumps create an important exception for the value of
PREVIOUS_MIX_VERSION. During a format bump, PREVIOUS_MIX_VERSION will be
overridden by the LAST_VER which will prevent PREVIOUS_MIX_VERSION from
altering format bump behavior.

Additionally, the mixer.state version was incremented and tests for
state file version conversions were added.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-04-25 18:23:40 +02:00
Rodrigo Chiossi f248c2b3b2 builder: Enforce offline mode in mixer versions
For `mixer versions` subcommand and `mixer versions update` when
--upstream-version flag was provided, builder would try to fetch
information about upstream about current version and format.

This patch provides an alternative output for `mixer versions` and
also skips upstream checks for `versions update` when in offline mode.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2019-01-18 15:12:10 +01:00
Tudor Marcu d1b80ca810 Fix formatting error
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-12-03 14:23:14 -08:00
Tudor Marcu 116c3ada8c builder: Only check online to update upstreamver
Updating mixver should not require a network connection, nor reach out
to the server to find out any more information than is needed.

Fixes #282

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-11-16 15:05:38 -08:00
Tudor Marcu f3e378381b Break up code and re-order logic better
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-11-13 12:18:22 -08:00
Tudor Marcu a9af245c72 Update format bump process
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-11-13 12:18:22 -08:00
Tudor Marcu 361d6964c3 metadata: Add useful update functions for bump
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-11-13 12:18:22 -08:00
Matthew Johnson ef52b7339e builder: break functions out into smaller files
Fixes #391
This patch greatly improves code readability by breaking up the goliath
builder.go into several new files containing similar functionality. Now
builder.go only contains the top-level build functions, constructors,
and types.

This patch contains no code functionality changes, the code is simply
moved around.

The builder.go file has been split out as follows:
* builder.go: contains all the top-level commands accessible via the
  commandline, such as BuildBundles, BuildUpdate, BuildImage etc. along
  with the type and const definitions.
* bundle_control.go: contains the mixer bundle * top-level commands and
  all the helpers that are used only by this functionality.
* bundle_validate.go: contains the bundle validation functions.
* bundles.go: added getClosestAncestorOwner to this file as it was the
  only file using this function (plus one reference in builder.go by the
  top-level BuildBundles).
* deltapacks.go: contains the internal function createDeltaPacks used by
  exported function in builder.go.
* repo_control.go: contains the dnf configuration controlling functions
  such as AddRepo, SetURLRepo, etc. Ideally this will eventually be
  moved to the config package.
* helpers.go: contains generic helper functions used by several files in
  the builder package.
* init.go: contains the functions to initialize the mix via mixer
  init.
* metadata.go: contains various metadata getters and setters for reading
  and updating versions, formats, and metadata files.
* update.go: contains the internal functions used by mixer build update.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-10-23 13:32:05 -07:00