Refactor metadata_manager to move to versions provider based model#244
Open
shiv-tyagi wants to merge 8 commits into
Open
Refactor metadata_manager to move to versions provider based model#244shiv-tyagi wants to merge 8 commits into
metadata_manager to move to versions provider based model#244shiv-tyagi wants to merge 8 commits into
Conversation
metadata_manager to move to versions provider based model
7ab3df1 to
23eb457
Compare
peterbarker
approved these changes
Jul 13, 2026
peterbarker
left a comment
Contributor
There was a problem hiding this comment.
Introduces a race condition where the SHA a user is dealing with can disappear while they're playing in the interface. Should be explicitly commented on somewhere. Even better if we can find a neat solution :-)
LGTM
| @@ -0,0 +1,9 @@ | |||
| from .manifest import ManifestJson | |||
Contributor
There was a problem hiding this comment.
Should probably be
Suggested change
| from .manifest import ManifestJson | |
| from .manifest import ManifestJSON |
| self._providers = providers | ||
| self.repo = ap_repo | ||
| self._remotes_json_path = remotes_json_path | ||
| self._access_lock = Lock() |
| redis==5.2.1 | ||
| dill==0.3.8 | ||
| requests==2.31.0 | ||
| packaging==26.2 |
Contributor
There was a problem hiding this comment.
This is a mismatch with the web requirements.txt
| def ap_firmware_manifest_url(self) -> str: | ||
| """URL for the ArduPilot firmware manifest.""" | ||
| return os.getenv( | ||
| 'AP_FIRMWARE_MANIFEST_URL', |
Contributor
There was a problem hiding this comment.
Suggested change
| 'AP_FIRMWARE_MANIFEST_URL', | |
| 'CBS_AP_FIRMWARE_MANIFEST_URL', |
maybe?
|
|
||
| def _write_cache(self, raw: bytes, meta: _CacheMeta) -> None: | ||
| self.cache_dir.mkdir(parents=True, exist_ok=True) | ||
| self.cache_path.write_bytes(raw) |
Contributor
There was a problem hiding this comment.
Consider writing into a separate file and os.replace instead - i.e. try to make both these file-writes closer to atomic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the versions manager to move to a versions provider based model.
We introduce three providers:-
I have tested this locally and it works good.
I will update #242 to use the same manifest json client we introduced in this PR to help listing the standard builds for a vehicle-version-release combination.