Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Verify source version before parsing PR #172

Merged
merged 1 commit into from Mar 9, 2020

Conversation

RoboCafaz
Copy link
Contributor

@RoboCafaz RoboCafaz commented Mar 5, 2020

fixes #171

Non-PR hooks can trigger builds in which the CODEBUILD_SOURCE_VERSION
would be populated as the commit SHA. Our current logic dictates that
that commit SHA would be passed onto CodeCov as the PR number, which
would always be an invalid value.

This updates the logic so that it will ensure that the environment
variable being checked actually matches the "pr/" pattern before trying
to use it. If it does not, it will return undefined.

Non-PR hooks can trigger builds in which the CODEBUILD_SOURCE_VERSION
would be populated as the commit SHA. Our current logic dictates that
that commit SHA would be passed onto CodeCov as the PR number, which
would always be an invalid value (must be a number, true, or falsy).

This updates the logic so that it will ensure that the environment
variable being checked actually matches the "pr/" pattern before trying
to use it. If it does not, it will return undefined.
@codecov
Copy link

codecov bot commented Mar 5, 2020

Codecov Report

Merging #172 into master will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
+ Coverage   90.16%   90.22%   +0.05%     
==========================================
  Files          23       23              
  Lines         356      358       +2     
  Branches       85       87       +2     
==========================================
+ Hits          321      323       +2     
  Misses         35       35              

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ebe132e...ef348ec. Read the comment docs.

@kisaraofpern
Copy link

Wonder if this also resolves #153.
#148 also appears to be similar, with #149 as a proposed solution that was merged.

Pinging @eddiemoore for his attention.

@eddiemoore eddiemoore merged commit eb8a527 into codecov:master Mar 9, 2020
@RoboCafaz RoboCafaz deleted the bugfix/codebuild-pr-parser branch March 10, 2020 16:32
@RoboCafaz
Copy link
Contributor Author

@eddiemoore Any timelines for a new version release?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codebuild configuration resolves PR option incorrectly on non-PR builds triggered by webhooks.
3 participants