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

Make Github Status namespace checks by APP ID #611

Merged
merged 1 commit into from
May 21, 2020

Conversation

Waterdrips
Copy link
Contributor

Description

The Github Status function was not namespacing the check-runs. It was
using the same ting for each installed app. This has been changed to
namespace by app_id. This means that 2 + installations on the same
repository can now correctly create & report github check runs.

Fixes #540

Signed-off-by: Alistair Hey alistair@heyal.co.uk

How Has This Been Tested?

This has been tested by installing 2x OCF installations, then running a
pipeline. This failed of half of the functions as they didn't get the
correct check for that app.

Then I added the new function to each OFC installation, and re-ran a
pipeline. Every check run was created and reported back correctly.

How are existing users impacted? What migration steps/scripts do we need?

Users with more than 1 app installed can correctly get statuses back from the OFC installations.

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • read the CONTRIBUTION guide
  • signed-off my commits with git commit -s
  • added unit tests

The Github Status function was not namespacing the check-runs. It was
using the same ting for each installed app. This has been changed to
namespace by app_id. This means that 2 + installations on the same
repository can now correctly create & report github check runs.

This has been tested by installing 2x OCF installations, then running a
pipeline. This failed of half of the functions as they didn't get the
correct check for that app.

Then I added the new function to each OFC installation, and re-ran a
pipeline. Every check run was created and reported back correctly.

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
@Waterdrips Waterdrips mentioned this pull request Apr 18, 2020
5 tasks
if os.Getenv("use_checks") == "false" {
return reportStatus(commitStatus.Status, commitStatus.Description, commitStatus.Context, event)
Copy link
Member

Choose a reason for hiding this comment

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

What kind of value was in commitStatus.Context before vs the static GitHub app ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://developer.github.com/v3/repos/statuses/

context | string | A string label to differentiate this status from the status of other systems. Default: default

default was always the value

Copy link
Member

Choose a reason for hiding this comment

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

OK, so did you pick the GitHub app ID because it should be unique between installations? It could be any identifier as long as it is consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeh, and its already included in the image as an env var

@Waterdrips
Copy link
Contributor Author

@alexellis any thoughs on merging this?

@alexellis alexellis merged commit 0d2ec50 into openfaas:master May 21, 2020
@Waterdrips Waterdrips deleted the fix-multi-apps branch July 16, 2020 06:41
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.

[Enhancement] Support multiple OFC apps per repository
2 participants