Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add managed layers to audit trail #599

Merged
merged 9 commits into from
Nov 3, 2024

Conversation

jkloetzke
Copy link
Member

Plus a couple of other fixes...

The "dir" attribute, like on all other SCMs, should be settable by
scmDefaults in default.yaml.
The "if" attribute is not evaluated and should better be rejected to
prevent the user from wondering why it's not working. Even more
importantly, the "dir" attribute would do active harm if used because
the layer would be at an unexpected subdirectory.
No need to construct a new RecipeSet object when getting the recipes SCM
status. In fact, this is actually harmful because the used layers are
unknown to the new object. The status line will be wrong as soon as we
support the layers status too.
When auditing recipes, the potential git checkout was not performed by
Bob. Hence, no information is available if submodules shall be checked
out or not. In this case, assume that potentially present submodules
ought to be checked out recursively. Previously, we assumed that
submodules must not be checked out which is a questionable assumption.
If the audit schema fails, it is most probably caused by an audit of a
newer Bob version. Add a hint to the user that an update might help.
Now that we support managed layers, its time to add the information to
the audit trail too.
Internally, the empty string is used for the main recipes.  Allowing
path separators in the layer name will probably also blow up. Rule out
both.

Some of the type checks were also missing. Make sure that the layer name
is a string and that a layers entry is a dict if not already a string.
Copy link

codecov bot commented Nov 3, 2024

Codecov Report

Attention: Patch coverage is 89.02439% with 9 lines in your changes missing coverage. Please review.

Project coverage is 88.90%. Comparing base (b9cf8fe) to head (c2e6a00).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
pym/bob/input.py 80.00% 6 Missing ⚠️
pym/bob/audit.py 93.33% 1 Missing ⚠️
pym/bob/cmds/jenkins/exec.py 0.00% 1 Missing ⚠️
pym/bob/scm/__init__.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #599   +/-   ##
=======================================
  Coverage   88.89%   88.90%           
=======================================
  Files          48       48           
  Lines       15360    15399   +39     
=======================================
+ Hits        13655    13691   +36     
- Misses       1705     1708    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jkloetzke jkloetzke merged commit 9a17f65 into BobBuildTool:master Nov 3, 2024
11 checks passed
@jkloetzke jkloetzke deleted the managed-layers-audit branch November 3, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant