Move to tea4j-autodeploy
#1088
Merged
mmarif
merged 49 commits from qwerty287/GitNex:autodeploy
into main
2 months ago
Reviewers
Request review
No reviewers
Labels
Requires and waits for changes in Gitea's API Backport
Bugfix ported to a release branch for point release Blocked
Waits for something else that must be solved first Brainstorming Breaking
Contains or will result in breaking changes Bug Cannot-reproduce Changelog CI
Related to the CI/CD Cleanup Confirmed Discussion Documentation Duplicate Enhancement External-dependecy F-droid Feature Frontport Good-first-issue Google-play Has-backport Improvement Invalid Investigate Long-term Major-release Minor-release Needs-backport Needs-cleanup Needs-feedback Needs-frontport Needs-help Performance Priority-critical Priority-high Priority-low Priority-medium Question Ready Refactor Regression Release Repository
Related to this repository and it's management Security Suggestion Summary Support Testing Translation UI/UX
Related to the user interface or experience Upstream Website
Related to the website Wontfix
This won't get fixed
Apply labels
Clear labels
API-dependency
Requires and waits for changes in Gitea's API Backport
Bugfix ported to a release branch for point release Blocked
Waits for something else that must be solved first Brainstorming Breaking
Contains or will result in breaking changes Bug Cannot-reproduce Changelog CI
Related to the CI/CD Cleanup Confirmed Discussion Documentation Duplicate Enhancement External-dependecy F-droid Feature Frontport Good-first-issue Google-play Has-backport Improvement Invalid Investigate Long-term Major-release Minor-release Needs-backport Needs-cleanup Needs-feedback Needs-frontport Needs-help Performance Priority-critical Priority-high Priority-low Priority-medium Question Ready Refactor Regression Release Repository
Related to this repository and it's management Security Suggestion Summary Support Testing Translation UI/UX
Related to the user interface or experience Upstream Website
Related to the website Wontfix
This won't get fixed
No Label
API-dependency
Backport
Blocked
Brainstorming
Breaking
Bug
Cannot-reproduce
Changelog
CI
Cleanup
Confirmed
Discussion
Documentation
Duplicate
Enhancement
External-dependecy
F-droid
Feature
Frontport
Good-first-issue
Google-play
Has-backport
Improvement
Invalid
Investigate
Long-term
Major-release
Minor-release
Needs-backport
Needs-cleanup
Needs-feedback
Needs-frontport
Needs-help
Performance
Priority-critical
Priority-high
Priority-low
Priority-medium
Question
Ready
Refactor
Regression
Release
Repository
Security
Suggestion
Summary
Support
Testing
Translation
UI/UX
Upstream
Website
Wontfix
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
4 Participants
Notifications
Total Time Spent: 40min 42s
Due Date
6543
40min 42s
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
This pull request currently doesn't have any dependencies.
Reference in new issue
There is no content yet.
Delete Branch 'qwerty287/GitNex:autodeploy'
Deleting a branch is permanent. It CANNOT be undone. Continue?
No
Yes
Move to https://codeberg.org/GitNex/tea4j-autodeploy as Retrofit interfaces. Closes #907 closes #1084
This also fixes parts of the crashes in #1082, so I recommend merging this before #1082.
please resolve conflicts :)
Here are my findings so far(not finished, just what I tested).
1- creating issue return "something went wrong", Miletstone return the class name. See screen shot.2- creating milestone, same here3- create release(cannot select branch)4- Adding colloborator does not return any user5- Create pull request, no branches(shows class name)6- Creating new file crahses the app7- Tap on Notifications craches8- Creating new repo crash app9- Creating org label craches the appSo far I can say there are a lot of crashes.
My opionoin is we should not hurry this to 4.3.0 as we are arlready facing problems and bugs to fix. We should do one major refactor for one release.
4.2.0 was released 1 month ago, I don't think we should keep this open for over a half year- just merge once finished and working.
can you bump to tea4j-auto version
a724545334c7ce30f0db07eda6fa4bbffd776347
?Can't reproduce create file issues, but this happens if trying to delete it. What should happen with it?
I think the client can not work with https://gitea.com/api/swagger#/repository/repoDeleteFile
as if you follow a "strict" rest guide a delete is not allowed to have a body - but we need a body to pass the options
That's a big problem, we had this issue another time. Gitea should follow the HTTP specs, maybe it could be possible to move something like this to query params (which is not a good idea, but the best). We can also take a look at https://github.com/square/retrofit/issues/330#issuecomment-25179351, but this will make it really hard to use autodeploy features because we would have to replace the usages of
@DELETE
where we need a body (which is pretty hard with a simple command line).You can always define custom classes with your own API endpoint descriptions when the generated code doesn't work as expected.
Yeah I think I have to submit a pull request for this because I have been using some funcs directly in gitnex https://codeberg.org/qwerty287/GitNex/src/branch/autodeploy/app/src/main/java/org/mian/gitnex/clients/RetrofitClient.java#L150-L193
Just enabled pull requests on the repository. 😉
Ah thanks then just ignore my discord DM 🙃
@mmarif I think I fixed all the issues you mentioned.
@qwerty287 thanks, I will soon check it out.
At the mean time as we are moved to gitnex org, you can update the repo, https://codeberg.org/gitnex/tea4j-autodeploy.
@qwerty287 can you resolve the conflicts?
TODOs:
@6543 thanks, will fix them when I get some free time
Test with the latest changes:
crash on commits
on create new issue getting something went wrong EDIT @qwerty287 can't reprocude - @mmarif see below task for detail.
crash on creating milestone EDIT @qwerty287 can't reprocude
crash on viewing releases after creating a release EDIT @qwerty287 can't reprocude - See the trace log below.
on creating new PR getting something went wrong
crash on commenting on PR EDIT @qwerty287 not related, mentioned in #1084
crash on edit org label
add/remove user to a team does not return anything
crash on releases/milestone/label tabs EDIT @qwerty287 can't reprocude - @mmarif trace log
issues counter(tab) does not update if you go back to list and go to the repo again after creating new issue. That maybe the repo list is not updated I guess when go back?
assignee list is random and sometime adding users not part of the org and sometime add org as user. In that case once you add that user as assignee it will throw something went error. API issue maybe? Referring the 2nd task from top. EDIT @qwerty287 can't reprocude - @mmarif see the video attached. This most probably not related to this, but wondering why assignee API return org as user. Paul is org, not user here. @mmarif I will leave it here as it looks like an upstream issue.
if you close an issue and come back to the list. You will still see the issue even after refresh. It litterly does not close it. EDIT @qwerty287 can't reprocude - @mmarif see attach video.
uff some conflicts ...
@mmarif I'm not entirely sure, but I think the issues you found are mostly fixed.
@qwerty287 I have tested the PR with latest changes. Most of the issues I mentioned are resolved, issue with org assignee is likely an upstream issue. So I will leave it there.
Here are the latest few issues from my quick test:
On creating new PR getting something went wrong
Adding new user to a team return upgrade to latest gitea warning
Issues(PR too maybe?) counter(tab) still does not update(after creating new issue) if you go back to the repo list and go to the repo screen again. That maybe the repo list is not updated I guess when go back?
Can't reproduce the PR issue.
@qwerty287 See the attached video for PR test.
The issue counter tab for new issue is resovled. But if I close an issue, it still does not update the counter. Even going back and forth to the lists(repos -> issues).
One more thing, should I go for the login tests as mentioned in #1084?
Forgot to mention, the PR problem could be related to label/milestone/due date selection as just before that I did not choose them and PR was created.
Talking about PR creation, the counter updated as normal upon creation, but the list did not show the new PR until I pulled down to refresh.
Also same as issue, now if you close/reopen the PR, it does not change the counter in any way including going to the repos screen.
If I click on the any issues/pr linked in the PR/issue
(#10)
and then go back to the main issue/pr(#10)
screen, the pull to refresh does not refresh anymore.Tested this after opening a linked issue/pr from a PR
(#10)
. Then went to that same PR(#10)
on the web and added new comment. Went back to the main PR(#10)
screen(GitNex) and pulled to refresh, the new comment did not show up.While testing that, the PR comment counter in the RP lists also did not update after going back to the list for that PR
(#10)
.I actually tried to create one with everything set (labels, milestone, due date), and it was working.
Ok, I will debug on my side.
Just now I was adding codeberg account and was greeted with "you are not authorized"(invalid creds) error(from add new account screen).
I switched to main which worked, but then had another issue which I mentioned in the bugs issue already.
EDIT: this happens on login screen too with token and username/pw.
The refresh issue is a general issue, I'll open a separate issue (for issue comments, it's fixed now). -> #1107
OK, so I can reproduce the account issue but don't know how to fix it. The commit I pushed fixes another issue related to this.
What I found out so far:
Authorization
andCache-Control
are not set in theCall
value. (Thus it does not work,Authorization
is missing)So this new code introduced is not working then:
.addInterceptor(auth)
EDIT: but what I am wondering is all API calls need that auth for completion, so it's not different than other calls. It must be something else somewhere.
I seems that it works for accounts already added / on other API requests. (The token is not the issue, tested that with a
println
- it is available and correct.)@qwerty287 I had a look at it, and fixed the login for tokens so far. Username/pw need a look still I guess.
Just noticed along the way, you used
AppUtil.switchToAccount(AddNewAccountActivity.this, account);
, while this is fine it does not refresh the view. Do you have any refresh call/method to use here?Oh you're right, didn't do this. But that's not related to this PR.
Maybe it's not. But I thought if there is a way to fix it straight away.
Yeah, feel free to do it, I can do it if I get some time.
Sure, I will look into it soon.
Bdw while testing this. I noticed if I log out and login with another account. I see not logged in text and no account in the nav drawer. Was this added in the other PR.
I feel the UX is not that good here. The old flow is fine to me. Show all accounts in nav and popup. once click just switch it. It is a seemless experience for user.
But for now I will leave it, we can discuss this later.
What I added was the logout system which allows logging in again. If you log out, the account is marked as logged out. The account is not shown on the nav drawer, but the alert dialog. There you can log in again. My main reason to change that was that the logout button is useless. You can't login again, and the LoginActivity is launched and can't be finished / exited, even after app restart. This is definitely a very bad UX. Another way would be to just remove the logout support and only keep the delete account option.
And how let's say I am going to add an account with username/pw if I delete an account and has only one account left in the app now?
We can't log out user with each delete for sure.
If I log out of an account and have other accounts configured, I expect that the app switches to another account or at least give me the option to switch to it.
What about username/pw support on AddNewAccountActivity?
We should rethink about the whole logout/account removal system and how this should be handled.
Accessing notifications:
Yes, anything regarding UX/UI we should discuss in the chat and how we can come up with a better solution for it.
Let's discuss this after 4.3.0 release.
@mmarif could you try again with
60432b6951
?See https://stackoverflow.com/questions/57376366/pass-query-date-param-in-specific-format for details.
Looks good. What about creating a custom endpoint with data type as string not date like last time?
Will this effect other calls with date?
The commit fixed all date usages.
This PR is pretty much there in terms of testing..
Will go through a round or two once fixed all the pending tasks(1 left) from #1084.
@qwerty287 if you found any other issues mentioned here or came across, please feel free to fix them.
@qwerty287 just tested the reload patch and unfortunately it is not reloading the file. Maybe something is missing in process of
editFileLauncher
. Maybe result is empty because it is not launched from edit file?If that's not working, you can always use a bundle and onResume to call
getSingleFileContents
.You're right, change https://codeberg.org/gitnex/GitNex/src/branch/main/app/src/main/java/org/mian/gitnex/activities/FileViewActivity.java#L299 (can't do it now).
Thanks, I will change it in a while.
@qwerty287 I have fixed few issues I came across. So far all is looking good. I will test it throughly one or two times again. If nothing, then will merge it. If there are things to fix, will fix what I can or list them here so you can try too.
@qwerty287 done from my side. If you have nothing to test or add, I will go ahead and merge it.
No, I don't have anything... If you want I can test some things again, otherwise just merge it. Thanks for fixing the missing bugs!
Sure, go ahead. I will wait until you test it.
Did some tests and fixed an (unrelated) issue, feel free to merge.
fbe55035f2
into main 2 months agoReviewers
fbe55035f2
.