You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a platform independent size analysis method (#52)
This adds a new method:
do_size(input_file: BinaryIO) -> BaseAnalysisResult
- Which takes a file-like input containing an artifact
- Uses ArtifactFactory to create an Artifact
- Creates the correct Analyzer
- Returns the result of the analyzer
The point of this is to minimize the amount of boiler plate required
in getsentry/sentry and the launchpad service when adding a new kind of
artifact to be analyzed. Ideally the code path for
{Android,Apple,Unity,.so,.exe,...} would be almost identical until it
gets to `do_size`.
Also add a matching CLI command for this `launchpad size`. This is done
in a separate file (src/launchpad/size/cli.py) showing how we could
split up the subcommand definitions and have them live near the code
they use as opposed to all have to be in a large monolithic file.
This replaces the existing size commands.
While here also do a few other small cleanups:
- Move `Console()` into `console.py` so we make only one instance
for the whole project (as suggested in the rich docs).
- Fix a few incorrect references to Android in artifact_factory.
- Add the ability for ArtifactFactory to take file-like objects as
input.
0 commit comments