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

extensions: add no_extension entry for parts #4209

Closed
wants to merge 1 commit into from

Conversation

artivis
Copy link
Contributor

@artivis artivis commented Jun 12, 2023

Add a new parts entry, no_extension, that prevent extensions from being applied to a part that sets this new entry to true.

Extensions' part_snippet are applied to all parts systematically. However in a multi-part snap, this behavior can cause issues, e.g. if the extension defines entries that are specific to a given plugin resulting in an Additional properties are not allowed error. This PR introduces a new entry that allows for explicitely shielding a part from having any extension applied to it, e.g. see here.

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run make lint?
  • Have you successfully run pytest tests/unit?

@artivis artivis force-pushed the feature/no_extension branch from e5c6cda to 3d8cde6 Compare June 12, 2023 08:18
@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2023

Codecov Report

Merging #4209 (7610d65) into main (0ad49f3) will increase coverage by 0.00%.
The diff coverage is 92.30%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main    #4209   +/-   ##
=======================================
  Coverage   88.98%   88.98%           
=======================================
  Files         296      296           
  Lines       20190    20201   +11     
=======================================
+ Hits        17966    17976   +10     
- Misses       2224     2225    +1     
Impacted Files Coverage Δ
snapcraft/extensions/_utils.py 96.96% <85.71%> (-1.37%) ⬇️
...gacy/internal/project_loader/_extensions/_utils.py 96.11% <100.00%> (+0.19%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@artivis artivis force-pushed the feature/no_extension branch from 3d8cde6 to 485f27a Compare June 19, 2023 15:45
@artivis artivis force-pushed the feature/no_extension branch from 485f27a to 7610d65 Compare June 21, 2023 14:00
@sergiusens
Copy link
Collaborator

we can rather make extensions per part plugin aware for these things

@artivis
Copy link
Contributor Author

artivis commented Jun 23, 2023

we can rather make extensions per part plugin aware for these things

I don't think the two features are mutually exclusive. Actually, you may want an extension to apply to a plugin type some times and not others (e.g. destkop to dump).

@sergiusens
Copy link
Collaborator

closing in favor of #4271

@sergiusens sergiusens closed this Jul 12, 2023
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.

3 participants