-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add HTTP-to-CD mirroring #821
base: main
Are you sure you want to change the base?
Conversation
Motivation: It would be very useful to set up a simple mirror that mirrors the result of an HTTP query into a repository, just like IFTTT. Modifications: - Added support for the following two new URL schemes: - `http` - `https` - Renamed `Mirror.remotePath` to `remoteSubpath` to better reflect what it actually does. - Made `Mirror.remoteSubpath` nullable because HTTP-to-CD mirror doesn't need it. - Added `HttpMirror` and `HttpMirrorTest`. Result: - A user can mirror a certain HTTP endpoint into a file in Central Dogma. - Closes line#154 Future works: - Add support for basic and token-based authentication - Add documentation
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.
Looks good all in all.
We also need to fix the test here:
Line 51 in 120597a
"localRepo=bar,remoteBranch=master,remotePath=/,success=true}", 1.0)); |
Thanks!
executor.execute(Command.push( | ||
MIRROR_AUTHOR, localRepo().parent().name(), localRepo().name(), | ||
Revision.HEAD, summary, "", Markup.PLAINTEXT, | ||
Change.ofTextUpsert(localPath(), content))).join(); |
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.
How about raising an exception before creating HttpMirror if localPath
is a directory?
public static final String SCHEME_HTTP = "http"; | ||
|
||
/** | ||
* {@code "http"}. |
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 think this annotation has a typo!
* {@code "http"}. | |
* {@code "https"}. |
Motivation:
It would be very useful to set up a simple mirror that mirrors the
result of an HTTP query into a repository, just like IFTTT.
Modifications:
http
https
Mirror.remotePath
toremoteSubpath
to better reflect whatit actually does.
Mirror.remoteSubpath
nullable because HTTP-to-CD mirror doesn'tneed it.
HttpMirror
andHttpMirrorTest
.Result:
Future works: