Commit f77cda7
feat: improve diffing between tilesets (#3555)
### Motivation
Our **basemaps-config** [preview links] for Elevation inserts don’t show
anything in Basemaps. You can’t see the imagery until you add the
following parameters:
[preview links]:
linz/basemaps-config#1323 (comment)
```
pipeline=terrain-rgb&format=png
```
We need to update the code that generates the markdown QA URLs to add
the `pipeline` and `format` key-value parameters automatically. The code
lives in the **cli-config** package’s [import] command.
### Modifications
The code for the **cli-config** package's `import` command needs some
re-work. We've opted to rebuild the code with a focus on improving the
_diffing_ logic and test suite. We've captured the rebuild as a new
`diff` command.
**packages/cli-config/src/**
- **`index.ts`**
- Added the new `diff` command to the `ConfigCli` list of sub commands.
- **\_\_tests\_\_/**
- **`config.diff.data.ts`** & **`config.diff.test.ts`**
- Added mock data and a test suite and for validating the behaviour of
the new _diffing_ functionalities provided by the `config.diff.ts` and
`config.diff.markdown.ts` files.
- **cli/**
- **diff/**
- **`config.diff.ts`**
- Implemented a new strategy for capturing the raster differences
between two bundled configs. We will extend this work in the near future
to capture vector differences, too.
- **`config.diff.markdown.ts`**
- Implemented a suite of functions for rendering the captured raster
differences as markdown.
- **`action.diff.ts`**
- Added a new `diff` command to capture the raster and vector
differences between two bundled config JSON files. The command also
generates new and improved markdown denoting the detected configuration
changes. This command will come to replace the _QA markdown_ role played
by the `import` command.
- **`action.import.ts`**
- Fixed a typo in the markdown produced by the `outputAnalyseReports`
function.
- **`config.diff.ts`**
- Added the `virtual` string to the `IgnoredProperties` array.
- **config/src/memory/**
- **`memory.config.ts`**
- Added an optional `source` property to the `ConfigProviderMemory`
class to store the `URL` of the bundled config.
- Extended the `fromJson` function to support a new `sourceUrl?: URL`
parameter.
<!-- TODO: Say what changes you made. -->
<!-- TODO: Attach screenshots if you changed the UI. -->
### Verification
- We have a test suite for validating the behaviour of the raster-based
_diffing_ functions.
- We don't have any tests for _vector diffing_ as we intend to re-build
that code in the near future.
- I have a **basemaps-config** pull request [here] that I've been using
to simulate layer additions, updates, and deletions for various tilesets
so that I can inspect the generated markdown.
[here]: linz/basemaps-config#1374
---------
Co-authored-by: Tawera Manaena <TManaena@linz.govt.nz>1 parent 1fc339c commit f77cda7
File tree
9 files changed
+1192
-79
lines changed- packages
- cli-config/src
- __tests__
- cli
- diff
- config/src/memory
9 files changed
+1192
-79
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
35 | 115 | | |
0 commit comments