-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat!: tracking from config #4
feat!: tracking from config #4
Conversation
Merge main into development
Major changesTo get rid of the database which sole purpose was to track pull-requests, I changed the way this works to instead rely on the configuration to know what to parse. To avoid using too much resources, it actually leverages the search API to directly fetch all open pull requests within orgs and repos. New items in the configuration: - uses: ubiquibot/automated-merging
with:
+ watch: [ "ubiquity" ]
- database: "sql.db" The accepted values are the following:
QA run |
Concerns On This ApproachThe only thing that makes sense to me is: when an event occurs within an organization, the plugin can search all open pulls across the entire organization, and not across other organizations. I think this also simplifies the implementation quite a bit. In this case, consider something like: - uses: ubiquibot/automated-merging
with:
repos_monitor: [ "ubiquibot" ]
repos_ignore: [] Concerns Regarding Property NamesI'm not super confident in picking property names because it is somewhat subjective, but the goal is to make development as unambiguous as possible.
I am very cautious to use similar property names for different purposes in our technology stack. We use Perhaps we should rename the manifest one to Footnotes
|
I can limit to the same organization eventually, but that actually complexifies the code because I should always check the org it comes from, and also it would not be possible anymore to target repositories located outside and organization. Also, it is currently not needed to have two fields watch:
- "ubiquibot"
- "-ubiquibot/automated-merging" would watch all Ubiquibot repos except |
I presume that the authentication is inherited from the original request? Meaning that the payload includes the installation ID, so then you can just use the same installation ID for any future read operations?
The intent is to make the config as expressive as possible for ease of use.
We can handle config renames over time. The priority now is just to get v2 functional (wen) so we can demo/promote at abs.io |
Then it would only be safe to run it within the org it is installed, I might be able to find that information somewhere in the payload. I will also create two fields for repositories then. |
Is the workflow present on the default branch? |
present on both branches yes, I haven't worked with workflows in ages it feels but everything appears right I have the correct bot permissions set, I have not changed logic in either the kernel or this plugin and the last time I ran a workflow plugin this format did work (I just comment them out in my config) I could only find two wf runs from this PR branch when I was trying to debug but they ran on |
I need a computer to test myself but I checked the repo and it seems right. Dunno if the kernel you're using is the latest version, but yesterday it was working fine with a specific branch for me. I will come back to you if I make some findings. In the meantime what you can try is adding a workflow_dispatch to try to manually trigger it and see if there is issues. @Keyrxng I tried using a specific branch and had no issue running it so far: https://github.com/Meniole/automated-merging/actions/runs/10295280986 with configuration looking like |
I had issues running the workflow for this repo for ages, I had to refork the repo and it allowed me to in the new fork I'm repeatedly being secondary rate limited running this workflow. Any ideas why this is happening? Below is the run and my rate usage after 4 attempts with time between each. The only repo secret I need to define is https://github.com/ubq-testing/automated-merging-qa/actions/runs/10368619910/job/28702614645
With config: - plugin: ubq-testing/automated-merging-qa:compute.yml@test
runsOn: [ "push" ]
with:
approvalsRequired:
collaborator: 1
contributor: 2
mergeTimeoutSchema:
collaborator: "2 days"
contributor: "5 days"
repos:
monitor:
- "ubq-testing/command-start-stop"
ignore:
- "bot-ai"
This doesn't seem right to me that it's on page 7 when searching for PRs in my QA org specifically only one repo I think is what should be happening because I've specified only one repo to monitor? |
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.
typebox enforces that approvalsRequired > 0
but mergeTimeout
can be 0, is this intentional or should it also be validated to be > 0?
"org/repo" works but "repo" does not appear to
this is a dangerous plugin in that only authorized users should be able to make changes I guess this would be covered by config-protection
as well?
cspell failed locally running yarn format
but doesn't appear to have affected CI. We have the workflow file but it's not recognized in the Actions
tab
I think it is okay because the merge timeout is represented as a string like "1 day", so errors would be easy to spot. "org/repo" or "org" are the only accepted patterns. You need to fully qualify repos to avoid errors when two orgs have the same repo name. I will check the Cspell problem. |
this plugin only works within an org so "org" is useless, and "org/repo" can be just "repo" |
Makes sense, will do the necessary changes. |
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 should use issues_comment.created
as the clock because it is the most frequent event. What is the reason you chose push
?
QA run: Meniole#10 (review) |
5588b2f
into
ubiquity-os-marketplace:development
Resolves #2