| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
`#!/usr/bin/env bash` should generally be used instead to avoid
breaking on systems that do not *have* a `/bin/bash`. This is just a
test, but rather annoying on my machine.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
It seems we don't need this anymore, thanks to cleaning up gRPC
background threads.
|
|
|
|
|
|
|
|
|
|
|
|
| |
To ensure that we only disable element loading task progress reporting
for very specific code paths, we need to teach the test suite to be a
bit smarter.
For this reason we now mock a _Task object and return it in our mock
context's relevant method invocations.
Other code paths that deliberately invoke the loader without task
reporting now mark their loads with NO_PROGRESS.
|
|
|
|
|
| |
Save all casd logs in a log file under its cas/ directory, and
keep only the last 10 of them.
|
|
|
|
|
|
|
| |
This adds messages in the various mis-termination of Buildbox-casd, to
notify users that something might have gone wrong there.
It also adds a few tests to validate the various behaviors.
|
|
|
|
|
|
|
|
| |
In changing the tests to use in_subprocess, they were modified to do
parametrization over both variables instead of looping over one in the
test itself. The purpose of the original code was to reduce the number
of test cases printed in the output. I have hence attempted to remove
superfluous test cases.
|
|
|
|
|
|
|
| |
Additionally, test code that was previous executed by a subfunction (in
the forked process) has been folded into the test function itself, as
separating it is now redundant. This removes some duplicate code for
setting up the context and project, etc.
|
| |
|
| |
|
|
|
|
|
| |
This is in preparation for buildbox-casd, which will disallow local CAS
cache writes from the main process (gRPC).
|
|
|
|
|
| |
This is in preparation for buildbox-casd, which will disallow local CAS
cache writes from the main process (gRPC).
|
| |
|
|
|
|
|
|
| |
`mapping.get_sequence(...).as_str_list()` is a very common
pattern seen both in plugins and the core. Adding a helper to reduce
the number of operations will make usage smoother
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
A 'clone' operation has an implicit understanding that it is expensive,
which is not the case of a 'copy' operation, which is more usually
a shallow copy.
Therefore renaming to 'clone'
|
|
|
|
|
| |
This makes the 'Node' API public, and available for use directly for
plugins.
|
|
|
|
|
|
|
| |
- _composite -> __composite (internal)
- composite -> _composite (BuildStream private)
- composite_under -> _composite_under (BuildStream private)
- get -> _get (internal)
|
|
|
|
|
| |
Users should not need to get access to any of those, and should only
need access to the ProvenanceInformation to print it.
|
|
|
|
|
|
|
|
| |
This replaces the helper method by adding a 'get_provenance' on the node
directly
- Adapt all call sites
- Delay getting provenance wherever possible without major refactor
|
|
|
|
|
|
|
|
|
| |
With nodes being propagated better, we now don't need to extract
provenance beforehand. Therefore removing the ability to provide
indiced when getting provenance.
- Also add 'scalar_at' on 'SequenceNode', in order to fetch a scalar
node at a specific indice
|
|
|
|
|
|
|
|
| |
This allows us to type its value more strictly, allowing for more
efficient access.
- Also implement 'node_at' on 'SequenceNode', to allow some tests to
test some internals generically.
|
|
|
|
| |
- adapt all call sites to use the new API
|
|
|
|
|
|
|
| |
Using 'Node.from_dict({})' can replace new_empty_node, and the rest
is not needed anymore.
- Adapt all call sites
|
|
|
|
|
|
|
| |
There was a single place using 'node_extend_list', which we can replace
more easily with 'SequenceNode.append'.
Also rewrite _projectrefs.py:_lookup to use the new API more effectively
|
|
|
|
|
|
|
| |
This new methods is here to replace the previous 'new_node_from_dict'
that will be moved to a private method.
Adapt all call sites to use the new 'from_dict' method.
|
|
|
|
|
| |
- Also take care of node_composite_move in the same way.
- Adapt all calling places
|
|
|
|
|
| |
'composite_dict' is a more internal method and we don't really need to
access it there
|
| |
|
|
|
|
|
|
| |
- Implement __setitem__ on 'MappingNode'
- Implement __setitem__ on 'SequenceNode'
- Adapt all call sites to use the new calling way.
|
|
|
|
| |
Also adaprt every part of the code calling it
|
| |
|
|
|
|
|
|
| |
- Add the 'as_int()' method on 'ScalarNode' to replace
'node_get(mapping, key, int)'
- Adapt all call sites 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.
|
|
|
|
|
|
| |
Instead of having methods in Context forward calls on to the Messenger,
have folks call the Messenger directly. Remove the forwarding methods in
Context.
|
|
|
|
|
|
|
|
| |
Remove the need to pass the Context object to message handlers, by
passing what is usually requested from the context instead.
This paves the way to sharing less information with some child jobs -
they won't need the whole context object, just the messenger.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
Node used to be a NamedTuple that we used to access by index
for speed reasons. Moving to an extension class allows us to
access attributes by name, making the code easier to read and
less error prone. Moreover, we do gain speed and memory by
doing this move.
Also fix a few places where we would not have an entire `Node`
object but were instead just returning a tuple, missing some entries.
|
|
|
|
|
|
|
|
|
| |
When running tests without --basetemp ./tmp, the path to the XDG_CACHE
will not be normalized, and we check that it is equal to the normalized
version of it.
This test only passes because it assumed "--basetemp ./tmp".
Now, it would work whatever the basetemp.
|
|
|
|
|
|
|
| |
Now that we permit `key in somenode` remove the no longer needed function
to check if a node contains a key.
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
|
|
|
|
|
|
|
|
|
| |
Replace YAML internals with a new Node type, and refactor everything
to use it cleanly.
This work was also by James Ennis <james.ennis@codethink.co.uk>
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
|
|
|
|
|
|
|
| |
The new YAML world order doesn't need the YAML cache, so remove it
before we begin the change.
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace some popular copypasta.
This important-looking invocation:
os.path.join(datafiles.dirname, datafiles.basename)
is equivalent to this shorter invocation:
project = str(datafiles)
It seems like it's very popular copypasta, replace it with the shorter
one thus:
# Use 'gsed' or 'sed' etc. as appropriate for your system.
git config --global alias.sub '!f() { git grep --name-only --null "$1" | gxargs --null gsed --in-place --expression "s/$1/$2/g" ; }; f'
git sub 'os.path.join(datafiles.dirname, datafiles.basename)' 'str(datafiles)'
|
|
|
|
|
| |
Pylint doesn't play well with pytest fixtures, we therefore need to
silence this error.
|
|
|
|
|
| |
Removes all the ones thare were not needed
Whitelist the ones that are actually needed for side effects
|
|
|
|
|
| |
This fixes a inconsistent-return-statements from pylint and makes it
easier to understand what is happening
|
| |
|