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 single-file command to nimbus-fml file to rationalize a complex graph of FML files #5676

Merged
merged 8 commits into from Jun 23, 2023

Conversation

jhugman
Copy link
Contributor

@jhugman jhugman commented Jun 21, 2023

Fixes EXP-3520.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due dilligence applied in selecting them.

Branch builds: add [firefox-android: branch-name] to the PR title.

@jhugman jhugman force-pushed the jhugman/exp-3520-merge-complicated-fml-into-single-file branch from a1a5eeb to d05d669 Compare June 21, 2023 13:58
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 93.69% and project coverage change: +0.04 🎉

Comparison is base (2051fa9) 84.02% compared to head (d05d669) 84.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5676      +/-   ##
==========================================
+ Coverage   84.02%   84.07%   +0.04%     
==========================================
  Files         106      109       +3     
  Lines       11272    11413     +141     
==========================================
+ Hits         9471     9595     +124     
- Misses       1801     1818      +17     
Impacted Files Coverage Δ
...ents/support/nimbus-fml/src/backends/kotlin/mod.rs 47.74% <ø> (ø)
components/support/nimbus-fml/src/backends/mod.rs 93.87% <ø> (ø)
...nents/support/nimbus-fml/src/backends/swift/mod.rs 24.56% <ø> (ø)
components/support/nimbus-fml/src/commands.rs 80.00% <ø> (ø)
...us-fml/src/fixtures/intermediate_representation.rs 100.00% <ø> (ø)
components/support/nimbus-fml/src/lib.rs 100.00% <ø> (ø)
components/support/nimbus-fml/src/main.rs 87.15% <7.14%> (-2.93%) ⬇️
components/support/nimbus-fml/src/workflows.rs 84.08% <91.66%> (+0.78%) ⬆️
components/support/nimbus-fml/src/frontend.rs 94.00% <94.00%> (ø)
...mponents/support/nimbus-fml/src/defaults_merger.rs 95.33% <95.33%> (ø)
... and 3 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@jeddai jeddai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! 🚢

Comment on lines +138 to +142
# This will move to the generate command when deprecated commands are removed.
# - channel:
# help: The channel to generate the defaults for
# long: channel
# takes_value: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Does this comment need to be here too?

.file_stem()
.ok_or_else(|| anyhow!("Manifest file path isn't a file"))?
.to_str()
.ok_or_else(|| anyhow!("Manifest file path isn't a file with a sensible name"))?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with a sensible name

😂 amazing

Comment on lines +939 to +956
#[test]
fn test_single_file_command() -> Result<()> {
test_single_merged_manifest_file("fixtures/fe/browser.yaml", "release")?;
test_single_merged_manifest_file(
"fixtures/fe/importing/including-imports/ui.fml.yaml",
"none",
)?;
test_single_merged_manifest_file(
"fixtures/fe/importing/including-imports/app.fml.yaml",
"release",
)?;
test_single_merged_manifest_file("fixtures/fe/importing/overrides/app.fml.yaml", "debug")?;
test_single_merged_manifest_file("fixtures/fe/importing/overrides/lib.fml.yaml", "debug")?;
test_single_merged_manifest_file("fixtures/fe/importing/diamond/00-app.yaml", "debug")?;
test_single_merged_manifest_file("fixtures/fe/importing/diamond/01-lib.yaml", "debug")?;
test_single_merged_manifest_file("fixtures/fe/importing/diamond/02-sublib.yaml", "debug")?;
Ok(())
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic

let observed = fm.default_json();

// They should be the same.
assert_eq!(expected, observed);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so to make sure I'm understanding this, this function that's used in the below test does the following?

  1. Load and get default json
  2. Generate the merged file
  3. Load merged and get default json
  4. Compare the initial file default and merged file default

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly so.

@jhugman jhugman added this pull request to the merge queue Jun 23, 2023
Merged via the queue into main with commit 3190a05 Jun 23, 2023
16 checks passed
@jhugman jhugman deleted the jhugman/exp-3520-merge-complicated-fml-into-single-file branch June 23, 2023 18:03
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.

None yet

3 participants