Skip to content

feat(symbol-collector): Add symbol-collector target#266

Merged
iker-barriocanal merged 37 commits into
masterfrom
iker/feat/symbol-collector
Jul 12, 2021
Merged

feat(symbol-collector): Add symbol-collector target#266
iker-barriocanal merged 37 commits into
masterfrom
iker/feat/symbol-collector

Conversation

@iker-barriocanal
Copy link
Copy Markdown
Contributor

The goal of the symbol-collector target is to continue automating the release of sentry-java (Android and Java). #258 automated publishing to Maven Central, and this PR automates uploading symbols to the Android Bucket.

@iker-barriocanal iker-barriocanal requested a review from BYK July 9, 2021 15:26
@iker-barriocanal iker-barriocanal requested a review from a team July 9, 2021 15:26
@iker-barriocanal iker-barriocanal self-assigned this Jul 9, 2021
@iker-barriocanal iker-barriocanal requested review from AbhiPrasad and rhcarvalho and removed request for a team July 9, 2021 15:26
Comment thread Dockerfile Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread src/targets/symbolCollector.ts Outdated
Comment thread src/targets/__tests__/symbolCollector.test.ts Outdated
Comment thread src/targets/__tests__/symbolCollector.test.ts Outdated
Comment thread src/targets/symbolCollector.ts
Comment thread src/targets/__tests__/symbolCollector.test.ts
Comment thread src/utils/system.ts Outdated
Comment thread src/utils/githubApi.ts Outdated
These were used in the past, but are no longer required.
Copy link
Copy Markdown
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

sweet! Left a couple suggestions. Thanks @iker-barriocanal

Comment thread Dockerfile
Comment thread Dockerfile Outdated
Comment thread README.md Outdated
Copy link
Copy Markdown
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

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

Didn't look too deep into tests but overall LGTM, great job!

Comment thread Dockerfile Outdated
Comment thread Dockerfile
Comment thread Dockerfile
Comment thread src/targets/symbolCollector.ts Outdated
Comment thread src/targets/symbolCollector.ts
Comment thread src/targets/symbolCollector.ts Outdated
Comment thread src/targets/symbolCollector.ts Outdated
Comment thread src/targets/symbolCollector.ts Outdated
Comment thread src/targets/__tests__/symbolCollector.test.ts Outdated
Comment thread src/targets/__tests__/symbolCollector.test.ts
Copy link
Copy Markdown
Contributor

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Nice! I would wait for Burak's answer about unzip before merging, but otherwise looks solid

Comment thread src/artifact_providers/base.ts Outdated
Comment thread src/artifact_providers/base.ts
Comment thread src/targets/__tests__/symbolCollector.test.ts Outdated
Comment thread src/artifact_providers/base.ts
Comment thread src/artifact_providers/base.ts
Comment thread src/artifact_providers/__tests__/base.test.ts
Comment thread src/targets/symbolCollector.ts
artifactProvider: BaseArtifactProvider
) {
super(config, artifactProvider);
this.symbolCollectorConfig = this.getSymbolCollectorConfig();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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()

Comment on lines +73 to +78
if (artifacts.length === 0) {
this.logger.warn(`Didn't found any artifacts after filtering`);
return;
}

this.logger.debug(`Found ${artifacts.length} symbol artifacts.`);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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', () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would have been better to make the executable path configurable and make sure we actually throw on a missing file.

Comment thread src/targets/__tests__/symbolCollector.test.ts
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.

4 participants