Automatically detect project changes that require a re-create call #3165
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 243 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.329
Real PR Conversation Timeline
1 comments
"Review active on #3165"
general
weight: 0.35
freakboy3742
Add tracking of the context variables used to generate a project template, so that when changes are made to projects settings, the potential impact can be detected.
For example, if you change the
versionof a project, you need to re-generate the project template to ensure that IDE and installer configuration files contain the new version number.This change reads the
cookiecutter.jsonfor a template, and extracts a list of keys; that list of keys are the template variables that the template is sensitive to. Those keys are extracted from the app context, and written tobriefcase.toml. The write is done through a TOML-safety mechanism, as defaults can sometimes manifest asNone, butNonecan't be output as TOML; so aNonevalue is converted to the sentinel "<::NONE::>" for serialisation.Before every run, build and package, the current app context is re-evaluated and converted to 'safe' TOML form. The context section of
briefcase.tomlis also read. If the (TOML-safe) value of any key stored in briefcase.toml is different from the current value, that indicates the template needs to be re-generated; the user is prompted (since this is potentially destructive if they've made manual changes).This requires moving all the context generation code into the base command, so that it is accessible to build/run/package commands.
The PR includes some refactoring of the tests for
generate_template; previously, most of the functionality was tested viagenerate_app_template, which is a wrapper aroundgenerate_templatethat adds app-specific behaviours.Fixes #472
Fixes #1531
PR Checklist:
<!--- Go over all the following points, and put an
xin all the boxes that apply. -->