This change modifies the LATEST field in status from always being a
revision to the same type as of the VERSION field.
If VERSION is a semver version, the LATEST would have the latest semver
version of the project constrained by the effective constraint.
If VERSION is a branch version, the LATEST would have the latest
revision of that branch.
* make importers error tolerant
- root_analyzer.go: Log a warning on encountering an unrecoverable error during
import of external config and proceed with the import for other packages.
Do not return error from private func `importManifestAndLock`.
internal/importers:
- base/importer.go:
- `loadPackages`: Do not return error. If `SourceManager.DeduceProjectRoot`
fails to determine the project root, log a warning and continue with the
rest of the imported packages.
- `ImportPackages`: Do not return error. When constraint resolution from the
lock hint fails, only log a warning.
- Importer implementations:
- Return an error from `Import` only for catastrophic failures(ex: yaml
parsing failed).
- `load`: Make it more error tolerant. Log warnings only for any of the
following scenarios:
- When and if a lock file, separate from the dependency file is present,
like, in the case of glide, and parsing fails. Continue with the import
as if the lock file was not present.
- If import packages are parsed line by line like in the case of glock,
and one of the line could not be parsed.
- `convert`: Do not return an error. Log warnings only for any of the
following scenarios:
- Expected field, such as `package` for an entry in `glide.yaml>imports`
is not present.
- Package was specified but the contraint could not be found.
* update importer tests
* improve importer warning msgs
Address feedback from @carolynvs
* add tests for importer failure scenarios
- internal/importers/base/importer_test.go:
- Check for warning when an invalid project is present whose project root
cannot be parsed.
- Check for warning when lock hint cannot be resolved correctly and the
constraint cannot be applied.
- Integration test for malformed external config(glide.yaml)
* tweak importer warnings
- {package => project}
- Improve warning message when no constraint is found for the package being
imported.
* update changelog
source
- main.go: Read and use env var `DEPCACHEDIR` for instantiating dep context.
- context.go:
- Add field `Cachedir` to struct `Ctx`. This holds the value of env var
`DEPCACHEDIR`.
- Use `Ctx.Cachedir` while instantiating `gps.SourceMgr` if present, fallback
to `$GOPATH/pkg/dep` otherwise.
- source_manager.go: Add a getter func `Cachedir` to facilitate testing in
`context_test.go`.
test
- context_test.go Add test to check `gps.SourceMgr` is instantiated with
appropriate `cachedir`.
- integration_test.go: Add test to check environment variable `DEPCACHEDIR` is
loaded and used if present.
misc
- update changelog
Move govendor files into importers pkg
Expose the base importer's source manager
It is used by the govendor importer to detect ignored packaegs
Update govendor importer to use base importer
Document exported members
Remove unused testdata
Import ignores with wildcards
Add govendor support to changelog
Do not import vendored sources
Don't require a revision to import govendor config
There are valid govendor configs in the wild that do not have a revision
set, essentially requiring the package but not locking to a revision. We
should allow that and not stop the import.
This change skips the root packages from missing package check if
there's a path to the corresponding package in manifest's ignored list.
`digestMismatch` is removed from `runStatusAll()`. When there's
a digest mismatch, it's an error. And we already log to stderr but never
returned an actual error. `errInputDigestMismatch` is now returned as error
when there's a digest mismatch.
Some refactoring in how we handle the returned info from `runStatusAll()`
and show the errors and their solutions.
This change makes `ensure -add` concurrently add the dependencies and
uses golang.org/x/sync/syncmap for a concurrent map to replace
addInstructions map.
Also, logs a message when the sources are being fetched.