feat(symbol-collector): Add symbol-collector target#266
Conversation
Instead of requiring having it installed locally, download the symbol collector and use the binary.
These were used in the past, but are no longer required.
bruno-garcia
left a comment
There was a problem hiding this comment.
sweet! Left a couple suggestions. Thanks @iker-barriocanal
BYK
left a comment
There was a problem hiding this comment.
Didn't look too deep into tests but overall LGTM, great job!
AbhiPrasad
left a comment
There was a problem hiding this comment.
Nice! I would wait for Burak's answer about unzip before merging, but otherwise looks solid
| artifactProvider: BaseArtifactProvider | ||
| ) { | ||
| super(config, artifactProvider); | ||
| this.symbolCollectorConfig = this.getSymbolCollectorConfig(); |
There was a problem hiding this comment.
This seems like a common pattern so maybe we should abstract config parsing into the base class and make sure it is always called by the default constructor parseTargetSpecificConfig()
| if (artifacts.length === 0) { | ||
| this.logger.warn(`Didn't found any artifacts after filtering`); | ||
| return; | ||
| } | ||
|
|
||
| this.logger.debug(`Found ${artifacts.length} symbol artifacts.`); |
There was a problem hiding this comment.
Should this logic be part of the base target class?
| artifacts.map(async (artifact, index) => { | ||
| const subdirPath = join(dir, String(index)); | ||
| await fsPromises.mkdir(subdirPath); | ||
| await this.artifactProvider.downloadArtifact(artifact, subdirPath); |
There was a problem hiding this comment.
Might be better to just return the final promise:
return this.artifactProvider.downloadArtifact(artifact, subdirPath);|
|
||
| jest.mock('../../utils/files'); | ||
| jest.mock('../../utils/system'); | ||
| jest.mock('fs', () => { |
There was a problem hiding this comment.
We may wanna lift the common fs mocks into a global mock module as this pattern seems common enough now.
| (checkExecutableIsPresent as jest.MockedFunction< | ||
| typeof checkExecutableIsPresent | ||
| >).mockImplementationOnce(() => { | ||
| throw new Error('Checked for executable'); |
There was a problem hiding this comment.
Would have been better to make the executable path configurable and make sure we actually throw on a missing file.
The goal of the
symbol-collectortarget is to continue automating the release ofsentry-java(Android and Java). #258 automated publishing to Maven Central, and this PR automates uploading symbols to the Android Bucket.