Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip SonarQube scan for PR from fork and allow compare_db workflow from fork #327

Merged
merged 4 commits into from
Sep 9, 2024

Conversation

georgemccabe
Copy link
Contributor

Pull Request Testing

  • Describe testing already performed for these changes:

None -- need pull request GitHub Actions workflows to run to confirm that the changes work as expected

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:
  • Check if SonarQube workflow shows a useful message to inform users why the workflow failed
  • Check if compare_db workflow succeeds from a fork
  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes ]

  • Do these changes include sufficient testing updates? [Yes]

  • Will this PR result in changes to the test suite? [No]

    If yes, describe the new output and/or changes to the existing output:

  • Do these changes introduce new SonarQube findings? [No]

    If yes, please describe:

  • Please complete this pull request review by 9/9/2024.

Pull Request Checklist

See the METplus Workflow for details.

  • Add any new Python packages to the METplus Components Python Requirements table.
  • Review the source issue metadata (required labels, projects, and milestone).
  • Complete the PR definition above.
  • Ensure the PR title matches the feature or bugfix branch name.
  • Define the PR metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Milestone as the version that will include these changes
    Select: Coordinated METplus-X.Y Support project for bugfix releases or METdataio-X.Y.Z Development project for official releases
  • After submitting the PR, select the ⚙️ icon in the Development section of the right hand sidebar. Search for the issue that this PR will close and select it, if it is not already selected.
  • After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
  • Close the linked issue and delete your feature or bugfix branch from GitHub.
    …so it is clear that the scan was not run

@georgemccabe georgemccabe added this to the METdataio-3.0.0 milestone Sep 5, 2024
@georgemccabe
Copy link
Contributor Author

georgemccabe commented Sep 5, 2024

UPDATE: I updated the logic to skip the code coverage jobs if the PR is from a fork. After this PR is merged, we should double check that a PR from dtcenter still generates the code coverage report properly.

@JohnHalleyGotway -- could you review the result of the SonarQube workflow coming from a fork? If we like the format, we could apply this to the other repositories.
https://github.com/dtcenter/METdataio/actions/runs/10725585739/job/29743751876?pr=327

Note the 2 later jobs that still run are set to run always to generate the code coverage report even if the tests fail. I'm not sure if there is a way to make it fail on the first failed job and prevent the other jobs from running even if they are marked with if: always()

… step to check for a fork PR is skipped, meaning the tests should run
@JohnHalleyGotway
Copy link
Contributor

@georgemccabe that log message seems clear and useful to me:

SonarQube scan cannot be run from a fork
Error: Process completed with exit code 1.

I suppose the only issue is if that feature is ever actually added, we'll want to revise this logic.

Thanks for working on this and providing a clear log message.

@georgemccabe georgemccabe merged commit e9b80b8 into dtcenter:develop Sep 9, 2024
8 of 9 checks passed
@georgemccabe georgemccabe deleted the feature_fix_compare_db branch September 9, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏁 Done
Development

Successfully merging this pull request may close these issues.

2 participants