This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow overriding the complement ref #11766
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Allow overriding complement commit using `COMPLEMENT_REF`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why using
COMPLEMENT_DIR
won't work for you? Do you not want to pull the entire repo for some reason? (It is relatively small IIRC.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is easier to update a single environment variable than having to add "install git, clone repo, checkout right commit, set environment variable" to our CI. It's not like we can't do that, but having to enabled/disable that every time the upstream complement doesn't work with the current synapse release is more effort than just telling it to use the right commit. I also just figured out how to do that correctly, after I hacked in the support for specifying a ref and using a ref is less effort. It might also be useful in the future, if complement ever gets branches for synapse versions like "synapse-1.50" or so (because sometimes the branches are just incompatible).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can also easily run the complement job in our CI with the complement ref overwritten, which makes it easier to figure out what commit actually works. We had to do that today, because the complement CA changes somehow don't work in our CI and we couldn't figure out why yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boiled down, this PR is the equivalent of adding the listed steps inside of
complement.sh
. One could also just easily add a "install git, clone repo, checkout right commit, set environment variable" bit to their dockerfile, and control which commit is checked out with another environment variable. And yes, that would work without adding another env var tocomplement.sh
.But this PR proposes upstreaming it as optional functionality into the script, so that every project doesn't need to set that up their own. It's a convenience that could save downstream developers time, so while it's not a necessary option (and is code we'll need to maintain), I think it's justifiable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also a really small change, because it just replaces the hardcoded master with an overrideable variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do branch matching in our CI for this reason, see:
synapse/.github/workflows/tests.yml
Lines 342 to 364 in c072c0b
We don't use
complement.sh
directly for Synapse CI, I'm not sure it is really designed for such things. Anyway, I agree that the overall change is relatively minor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I guess we should do that too at some point then. I was mostly happy we got it working at all :D