-
-
Notifications
You must be signed in to change notification settings - Fork 23
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 support for Gitea #124
Conversation
buildbot_nix/__init__.py
Outdated
@@ -239,7 +262,9 @@ def __init__(self, **kwargs: Any) -> None: | |||
@defer.inlineCallbacks | |||
def run(self) -> Generator[Any, object, Any]: | |||
# run `nix build` | |||
cmd: remotecommand.RemoteCommand = yield self.makeRemoteShellCommand() |
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.
What was the issue with the previous line?
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.
All of your questions, types, typechecking seemed to be broken for me, soemhow through a yield it wouldnt type check, my guess is that a yield can return an error value. I wanted to remove all the type errors so its easier for me to write (and for the future). I can revert these bits no problem if so desired
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.
What typechecker are you using? It works with mypy here.
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.
pyright
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 will try mypy then and clean up these workarounds 👍. Sorry for the mess
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.
Alright. You can use nix fmt
to get a local type check.
buildbot_nix/__init__.py
Outdated
@@ -224,7 +245,9 @@ def run(self) -> Generator[Any, object, Any]: | |||
error = self.getProperty("error") | |||
attr = self.getProperty("attr") | |||
# show eval error | |||
error_log: Log = yield self.addLog("nix_error") | |||
# TODO why doesn't type information pass through yield again? | |||
error_log_: object = yield self.addLog("nix_error") |
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.
same question as above.
buildbot_nix/__init__.py
Outdated
self.observer = logobserver.BufferLogObserver() | ||
self.addLogObserver("stdio", self.observer) | ||
self.supported_systems = supported_systems | ||
|
||
@defer.inlineCallbacks | ||
def run(self) -> Generator[Any, object, Any]: | ||
# run nix-eval-jobs --flake .#checks to generate the dict of stages | ||
cmd: remotecommand.RemoteCommand = yield self.makeRemoteShellCommand() |
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.
Same question as above.
buildbot_nix/__init__.py
Outdated
self.stdio_log: Log = yield self.addLogForRemoteCommands("stdio") | ||
|
||
# TODO why doesn't type information pass through yield again? | ||
stdio_log_: object = yield self.addLogForRemoteCommands("stdio") |
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.
Same question as above.
@mergify rebase |
✅ Branch has been successfully rebased |
dc99e6e
to
b608c2b
Compare
abcf8e9
to
67df676
Compare
Ready for review! I verified all functionality to be working against a fork of this repository at https://github.com/magicrb/buildbot-nix and https://codeberg.org/magic_rb/buildbot-nix. No regressions have been introduced as far as I can tell. The following section includes notes that I took while working on this. Initial Setup
Removing GitHub Assumption
Adding Gitea
Cleanup and Finalizing
Lastly: |
Very happy for this, thank you. Out of interest, would this support private forgejo/gitea repos or public only? |
If the buildbot instance can access the instance, https works, then it should be fine I think. It is untested though. |
oh yeah, there are a few unresolved things:
|
Signed-off-by: magic_rb <richard@brezak.sk>
Signed-off-by: magic_rb <richard@brezak.sk>
c61cc63
to
3f01a96
Compare
# TODO unused | ||
buildbot_user: str |
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.
Does TODO unused
mean buildbot_user
can be removed?
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.
At the time I wasn't a 100% sure, but now I am, and yes it can
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.
Thanks, I'll send a PR.
This pull request is just there to publicize the code I'm working on, before being ready it'll get probably more cleaned up and merged with the Gitea backend pull request.