-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Allow to select the branch to release #1507
Allow to select the branch to release #1507
Conversation
I made the code BC for the controller which display the next release. But should we update them in order to display all the branches ? WDYT @sonata-project/contributors ? |
I need to make more test for release on master branch. But I'm currently getting
|
I like the idea, and it is probably a good solution, but we have a problem with the github api calls. One question, does packagist expose an api for releases? |
I don't know why but I'm getting
When trying to run the command with cc @OskarStark |
It's not supposed to make a lot more calls than before.
I'm not sure packagist would be better since we still have a lot of github checks to do. We should look for caching calls or having more call to github per hour... |
we should have 5000 calls per hour: https://docs.github.com/es/rest/overview/resources-in-the-rest-api#rate-limiting something is wrong here |
Did you add your github token on .env? |
Yes. But when I dump the authenticate method it seems like it's not called.
is not used |
Yes, if I call manually |
This also explain why the cache is not used on the website. Now, how to fix this ? |
Adding
Does call I don't know why it need to be public... |
config/packages/github_api.yaml
Outdated
@@ -1,4 +1,10 @@ | |||
services: | |||
_defaults: | |||
# The Github\Client is only calling authenticate/addCache when public (but I don't know why) |
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.
Nice catch, can you open an issue on the repo and ask?
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.
Should it be on the Github\Client repo or on the symfony repo ?
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 that would happen, just making Github\Client
public fixes the issue or should all services defined there be public?
I've never used the commands.
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 just discovered that I don't need to add
_defaults:
# The Github\Client is only calling authenticate/addCache when public (but I don't know why)
public: true
autowire: true
autoconfigure: true
If I remove the call
- ['addCache', ['@Cache\Adapter\Redis\RedisCachePool']]
Maybe it's related to the failure I get
[WARNING] Some commands could not be registered:
In getClientService.php line 53:
Connection refused
The failure of one calls is denying every calls ? how to solve this ?
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.
@sonata-project/contributors Any idea why the addCache
call is disabling the github authentication ?
@OskarStark should we remove it ?
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.
Maybe this helps?
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.
Ok I found the reason.
When I correctly configure redis
the authenticate
call is made.
So it was related to the error
[WARNING] Some commands could not be registered:
In getClientService.php line 53:
Connection refused
Is there a way to add the addCache
call only if redis server is started, in order to not lose the authenticate
call when the redis server is not started ? ^^'
src/Action/DetermineNextRelease.php
Outdated
|
||
try { | ||
$currentRelease = $this->releases->latest($repository); | ||
$currentRelease = $this->releases->branchLatest($repository, $branch); |
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.
$currentRelease = $this->releases->branchLatest($repository, $branch); | |
$currentRelease = $this->releases->latestBranch($repository, $branch); |
(I think)
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.
The method fetch latest release from given branch, maybe should simply be latestRelease, or more verbose latestBranchRelease
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.
There is a latest
method. It would be weird to add Release
to this method and not the latest
one.
Here I wanted to say it's the branch's latest release. So branchLatest.
Maybe latestForBranch is more clear ?
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 made the change @franmomu @jordisala1991
I think this is ready to be merged :) |
I used it for sonata-project/SonataBlockBundle#879