| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This includes adding an entry for the recursive submodules changes from !1765,
and adding myself to the authors of _gitsourcebase.py.
|
|
|
|
|
| |
The functionality has been split into three new functions:
to_commit, reachable_tags, and describe. No behaviour is changed.
|
|
|
|
|
|
|
|
|
|
|
| |
The beginning parts of git-describe labels are completely arbitrary.
They can be changed either manually or by a track (e.g. if a tag is
moved, added or deleted) even if the referenced commit is the same.
Hence, only the commit ID part of the label should factor into the cache
key.
This commit, of course, breaks cache keys for artifacts built with the
'git' source with git-describe refs.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This changes how the Git repo in the source cache is managed.
The mirror is not created with an initial clone, but is set up manually from
an empty repo. This is to support shallow cloning in future changes.
To simplifiy code and Git calls, remotes are no longer used; instead URLs
are passed on the command-line.
|
|
|
|
|
| |
This is not needed now that we have 'is_resolved' and 'is_cached'.
We can therefore drop all calling places and implementations of it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the need to use consistency in Sources, by asking
explicitely whether the source is cached or not.
This introduces a new public method on source: `is_cached` that needs
implementation and that should return whether the source has a local
copy or not.
- On fetch, also reset whether the source was cached or set if as
cached when we know it was.
- Validate the cache's source after fetching it
This doesn't need to be run in the scheduler's process and can be
offloaded to the child, which will allow better multiprocessing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`get_consistency` is coarse grained and hard to optimize, in addition
to being un-userfriendly.
This adds a new `is_resolved` that has for default implementation
`get_ref() is not None`, which is true for most sources in BuildStream.
Sources for which this is not true can override the method to give a
more accurate description.
Checking for this before looking whether the source is cached can
reduce the amount of work necessary in some pipeline and opens the
door for more optimizations and the removal of the source state check.
|
|
|
|
|
| |
"Ignore submodule" sounds like it could be an action, so this changes the name
to more clearly be a predicate.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, GitSourceBase would only consider immediate submodules of the
superproject. It now fetches and stages recursively.
To achieve this, this commit somewhat refactors the relationship between
GitMirror and GitSourceBase. Enumerating GitMirrors for the submodules is now
done in GitMirror itself. GitSourceBase recursively iterates these mirror
classes with _recurse_submodules and applies the source configuration with
_configure_submodules.
|
| |
|
|
|
|
|
|
|
| |
As discussed over the mailing list, reformat code using Black. This is a
one-off change to reformat all our codebase. Moving forward, we
shouldn't expect such blanket reformats. Rather, we expect each change
to already comply with the Black formatting style.
|
|
|
|
|
| |
As per the documentation, sources are required to return 'None'
when their ref is unset.
|
|
|
|
|
|
|
|
| |
This adds a method to ensure that a value is from a set of valid values
and raises an error message accordingly.
- Define Enum types for each of the relevant cases
- Adapt call places that were doing such things manually
|
| |
|
|
|
|
| |
- adapt all call sites to use the new API
|
|
|
|
|
| |
This mimics the dict.keys() method but returns a list instead of a
dict_keys, for cython performance reasons
|
|
|
|
|
|
|
|
|
| |
- Adding 'get_sequence' on MappingNode to access sequences in a mapping
- Adding 'sequence_at' on SequenceNode to access sequences in a sequence
- Adding 'mapping_at' on SequenceNode to access mappings in a sequence
Using "*_at" in sequences allows us to quickly understand if we are
dealing with a sequence or a mapping.
|
|
|
|
|
|
|
|
|
|
|
| |
- 'as_bool()' casts a ScalarNode into a boolean, understanding both
'True' and 'False' as truthy-falsy values, as per node_get(type=bool)
behavior
- 'is_none()' allwos checking whether the scalar node contains a 'None'
value. Since 'None' cannot be used when working with booleans, we need
to have a way of checking for 'None' when we actually need the
information of whether the value is unset.
- Adapt all call places to use the new API
|
|
|
|
|
|
|
|
|
|
| |
- 'get_scalar()' allows retrieving a scalar node from a mapping.
- 'as_str()' casts a ScalarNode into a string (thus removing the node
information).
Both together, those replace 'node_get(mapping, key, type=str)' but
also allow retrieving the 'Node' itself, which will allow in the future
lazier provenance computation.
|
|
|
|
|
|
|
|
| |
This allows to get a mapping node from another 'MappingNode',
replacing 'node_get(my_mapping, key, type=dict)'
Also changes all places where 'node_get' was called like that by
the new API.
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyLint helpfully points out that _GitMirror.fetch() does not match
SourceFetcher.fetch() - it is missing the *kwargs argument. The same for
_GitSourceBase.track().
Move towards being able to enable the 'arguments-differ' error faster
by side-stepping the class design debate and ignoring the error for now.
Change _GitSourceBase.set_ref() argument names to match
Source.set_ref().
|
|
|
|
|
|
|
|
|
|
|
| |
Calls to `isinstance` can be particularily costly. Using type() is
much faster. The only known case where the `isinstance` was useful
is for dictionnaries where we would ask for a 'Mapping' instead.
Disallowing 'Mapping' for expected_type considerably speeds up the
calls to this functions.
Also add into NEWS
|
|
This was discussed in #1008.
Fixes #1009.
|