Merge ~sylvain-pineau/checkbox-ng:no_validation_context_env_var into checkbox-ng:master

Proposed by Sylvain Pineau
Status: Rejected
Rejected by: Sylvain Pineau
Proposed branch: ~sylvain-pineau/checkbox-ng:no_validation_context_env_var
Merge into: checkbox-ng:master
Diff against target: 13 lines (+2/-0)
1 file modified
plainbox/provider_manager.py (+2/-0)
Reviewer Review Type Date Requested Status
Checkbox Developers Pending
Review via email: mp+356574@code.launchpad.net

Description of the change

If a project snap wants to use the content interface to load the base providers, needless to build it with parts for all those providers.

So far we have to as they are used to pass the project provider validation.

This patch allow such provider to perform only "static" validation (i.e with no context, without trying to load all possible providers).

As an example:

parts:
[...]
  checkbox-provider-foo:
    plugin: plainbox-provider
    source: ./checkbox-provider-foo
    after: [checkbox-ng-dev]
    build-environment:
      - PROVIDER_NO_VALIDATION_CONTEXT: "1"

Note: build-environment requires snapcraft snap from edge

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

What is an example of a validation failure that would happen without this change?

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Unmerged commits

57f5a83... by Sylvain Pineau

provider_manager: Validate without context if special env var is set

PROVIDER_NO_VALIDATION_CONTEXT=1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/plainbox/provider_manager.py b/plainbox/provider_manager.py
2index 96767ea..e50b42b 100644
3--- a/plainbox/provider_manager.py
4+++ b/plainbox/provider_manager.py
5@@ -1075,6 +1075,8 @@ class ValidateCommand(ManageCommand):
6 unit_list, exc_list = self.collect_all_units(provider)
7 early_issue_gen = self.get_early_issues(exc_list)
8 context = UnitValidationContext(provider_list)
9+ if os.getenv("PROVIDER_NO_VALIDATION_CONTEXT", default=0):
10+ context = None
11 issue_gen = self.validate_units_in_context(context, unit_list)
12 del context
13 failed = False

Subscribers

People subscribed via source and target branches