Commit Graph

507 Commits

Author SHA1 Message Date
Pavel Gromov
5d185c30d9 [gitlab] Clone dialog: handle connection exception
#IDEA-324778 Fixed

GitOrigin-RevId: 19df27aec55e9d0c9228394deb625b69257f742b
2023-08-22 23:24:31 +00:00
Chris Lemaire
d030a52289 [gitlab] Annotate GQL data and queries with @SinceGitLab
This puts a version on GitLab's 'versionless' API.

For this, I pulled ~50 docker images, usually for different
minor versions. Starting at 8.1.2, going through to 12.0.0
only major versions were checked. 12.0 introduces a GraphQL
API that has downloadable metadata. For each version of
GitLab CE, I span up a container and retrieved a GQL schema.

The currently annotations only cover community edition APIs
as EE that's the docker images I got to pull. Currently,
these annotations might seem a bit much, but I believe it's
useful to have a constant reminder of compatibility in the
codebase rather than having a step in-between.

GitOrigin-RevId: 2722680168df507588895df12ea34451136a6941
2023-08-21 20:32:23 +00:00
Chris Lemaire
e068068a87 [gitlab] Add @SinceGitLab annotation to help document API changes
The current set of changes is incomplete, but can be narrowed down
further with some investigation. REST endpoints and their changes need
to be documented completely manually, but for GraphQL changes, we can
download changelogs from various versions of GitLab.

GitOrigin-RevId: 973485ab607334fb072836c9b76befebeec072fc
2023-08-21 20:32:23 +00:00
Ivan Semenov
8014283bdb [github/gitlab] open commit instead of a file-in-commit from annotation
#IDEA-326244 Fixed
#IDEA-325115 Fixed

GitOrigin-RevId: ab3caca451366fd68a852632b89560aebdf242af
2023-08-18 11:35:24 +00:00
Ivan Semenov
fabc365d9c [gitlab] get rid of wrapper for merge request iid
it was planned to be used as a carrier for gid/iid but iid is used everywhere so there's no point

GitOrigin-RevId: 5315b017ae44e1b61613c769f75c4c742530076a
2023-08-17 20:12:47 +00:00
Ivan Semenov
335a4ebcef [gitlab] display merge request on current git branch in branch widget and open on action
#IDEA-327162 Fixed

GitOrigin-RevId: 4e9af9c909b239520471491b73eaa7fb860d9630
2023-08-17 20:12:47 +00:00
Ivan Semenov
bdc2d8faef [gitlab/github] sync TW management implementation
GitOrigin-RevId: dcbc3ef4b501d0af4d580578e16104fbc769f3cd
2023-08-17 20:12:47 +00:00
Ivan Semenov
03c350e695 [gitlab] initialize project connection for MRs eagerly
GitOrigin-RevId: 1dcaebda197b6dbecdf3702f6aff6d3876a12f83
2023-08-17 20:12:47 +00:00
Vladimir Krivosheev
8dd13764a9 IDEA-326151 update hash algo for icons
GitOrigin-RevId: bb8f3acd0314190362619afb86151270b893f082
2023-08-09 14:46:20 +00:00
Chris Lemaire
179a81d4ff [gitlab/collab] Improve overall coroutine usage and UI
- Replace `.trim().isEmpty()` with `.isBlank`
- Split off PathHandlingMode into a separate class
- Allow emitting values directly to account flow of VM
- Make fields of dialog grow horizontally
- Make description field 4 rows tall and make it grow with the row
- Rename `canOpenDialog` to `canCreateSnippet`
- Refactor suspend + explicit CoroutineScope param to just be suspend functions
- Fix coroutine scope for create snippet window to be modal
- Remove unused bundle messages
- Ensure the child scopes of a surrounding coroutineScope are finished before ending the outer scope
- Refactor the result of a view model to be a new data class
- Remove attempts to circumvent dumb GL lowercase naming schemes with a 'value' field in enum
- Remove unused imports
- Simplify getting Http result extracted
- Always show 'snippet' created notification when successful
- More explicitly show and set the scope of repository flows
- Replace shared flows in VM with modelFlow
- Validate create snippet dialog with built in doValidate
- Ask user to re-login if no token could be found for the user

GitOrigin-RevId: 76a1c5b0462c87f05fa30a0d65bdbd7a81abf8d9
2023-08-04 16:25:00 +00:00
Chris Lemaire
bc5e2f0253 [gitlab] Make unavailable path handling modes disabled rather than invisible
GitOrigin-RevId: a56518ef8eb3132a2d549326360d030da4d5dc00
2023-08-04 16:24:59 +00:00
Chris Lemaire
cfaa14ef3c [gitlab] Misc. fixes
- Fix compilation by reverting accidental change during rebase
- Refactor VM to make it own the collectContents call
- Factor out duplicate calls to service() in service test and view model
- Bump VCS counters version
- Surround collecting content with read action
- Remove check that HTTP status is not 200
- Fix CoroutineScope passed to VM not being a temp. CS
- Make file name extractor a suspend function and change read action
- Split off some functions from the performCreateSnippet function for readability
  Specifically: creating the snippet using GL GQL API
  and showing and getting dialog results
- Factor out action events from service methods

GitOrigin-RevId: 4d15f1b1651e410d05673eef255d7ff3f698a27c
2023-08-04 16:24:59 +00:00
Chris Lemaire
79179a328f [gitlab] Rename snippet blob actions and don't pass around file name extractor function
GitOrigin-RevId: 9fb57aaee6abf0777ca822d91e524a0809be3747
2023-08-04 16:24:59 +00:00
Chris Lemaire
a92d879d66 [gitlab] Only allow Ok'ing the dialog when a title is entered
GitOrigin-RevId: 341baca87606b0c8ae16d4a12aeb20bb91d14d77
2023-08-04 16:24:59 +00:00
Chris Lemaire
7a83d51cd2 [gitlab] Only show snippet button when there are GL accounts
GitOrigin-RevId: 0f414fca36aa3b66710404722f1f90c8e5d037ef
2023-08-04 16:24:59 +00:00
Chris Lemaire
feb9f0936e [gitlab] Only show snippet button when files selected
GitOrigin-RevId: 79135ab5867b069f85f80aea3f3c9b16f881b3f1
2023-08-04 16:24:59 +00:00
Chris Lemaire
2c7dfa1889 [gitlab] Add an option for path handling and implement file -> path function
GitOrigin-RevId: fe62bd16b782be42227e3f353ebb7c20598929c5
2023-08-04 16:24:59 +00:00
Chris Lemaire
3e2225ce6e [gitlab] Add copy-url and open-in-browser options for Snippet creation
GitOrigin-RevId: df4a1f76906d8d8bb29ebcea01ddb7130b5d8039
2023-08-04 16:24:59 +00:00
Chris Lemaire
f09982b4dd [collab/gitlab] Get rid of println's to debug requests
GitOrigin-RevId: c780cc89e2e7fd0a54ddc6c157ac8c6fdf78edec
2023-08-04 16:24:59 +00:00
Chris Lemaire
c066c4771f [gitlab] Move account selection and make invisible when no. accs. < 2
GitOrigin-RevId: 076bab7bd62d0137824912549b47750209ca9fe8
2023-08-04 16:24:59 +00:00
Chris Lemaire
b543d08016 [gitlab] Rename getOwnedProjects to getMemberProjects
GitOrigin-RevId: 3dcca5a002963c00be12add5f3f6ed4f15e0a306
2023-08-04 16:24:59 +00:00
Chris Lemaire
2fa77353dd [gitlab/collab] Add initial GitLab snippet creation (IDEA-201207)
Additionally:
- Fixes a so-far unknown bug/feature which caused only the first selection in a multi-select to be uploaded.
  Honestly don't think it'll appear often that someone wishes to do that though.
  'fix' is to pass `true` to the function gathering selected text.

Leftover debt:
- Some println's used to debug
- No tests.

Currently known issues:
- Does not handle errors from GQL for instance in an ideal way.
- UI of 'Create Snippet' dialog may require some updating.
  Specifically account select may be moved, the UI should be resized, etc.
- The first account is currently not selected automatically.
- Title can be left empty, but should be required.
- The 'Create Gist' button should not appear when content is empty or there are no logged in accounts.

Project is left intentionally unselected, but might be best to automatically select in the future?

GitOrigin-RevId: f2caeee92d07ada938dfda131884d166cd007336
2023-08-04 16:24:59 +00:00
Ivan Semenov
651fed621a [gitlab] do not parse response of MR un/approval requests
We do not use the returned value anyway and CE server returns a different response

#IDEA-327549 Fixed

GitOrigin-RevId: c76475602782a1dc2ca9d7257ecff10c4dd97154
2023-08-04 15:24:49 +00:00
Ivan Semenov
410a978d3e [gitlab] recreate more action group on MR role change
#IDEA-327338 Fixed

GitOrigin-RevId: 969e88a79b7b605acc57793d763820ec3bea96dc
2023-08-03 12:19:37 +00:00
Ivan Semenov
7f04bcbeb6 [gitlab] save new account when logging into git
#IDEA-327302 Fixed

GitOrigin-RevId: bf68dfd957f514dc3b431c4698520389ba93af24
2023-08-02 15:07:04 +00:00
Ivan Semenov
60e46ec03c [gitlab] cleanup file structure
GitOrigin-RevId: 75c3ef843b88771d726c5ee248a65cc05dfe3fc9
2023-08-02 15:07:00 +00:00
Ivan Semenov
0f737a98e1 [collab/github/gitlab] load resource file from a proper path
IDEA-327023 Fixed

GitOrigin-RevId: 45163b99f4813cc442640eff9429e63ea71904f0
2023-08-01 12:00:22 +00:00
Ivan Semenov
4f21cd7df1 [gitlab] always show a merge action for reviewer
IDEA-326973 Fixed

GitOrigin-RevId: 93e989910fda184bef576207219e5697a9633095
2023-08-01 12:00:17 +00:00
Ivan Semenov
39d4f68aaf [gitlab] try to load versions lower than 14
GitOrigin-RevId: 588812949d734eeb5d9f37bfbfe2d2e8328ef4ea
2023-07-31 11:41:01 +00:00
Ivan Semenov
f08bd8b175 [collab/gitlab] share fragments cache between GQL loaders
GitOrigin-RevId: faa7b01f7251eae04a33b4c007d2bbb687fc5360
2023-07-31 11:41:01 +00:00
Ivan Semenov
38239f1662 [collab/gitlab] use a different model for loading MR's for community edition server
GitOrigin-RevId: 319ab608f1083de731d335e19a45a98c44901283
2023-07-31 11:41:00 +00:00
Ivan Semenov
a44cbb4198 [collab/gitlab] extract review change list component factory
GitOrigin-RevId: 255572f3642ea1a4a726f3c293d0473914138b0f
2023-07-25 15:38:28 +00:00
Ivan Semenov
c62259d1cc [collab/gitlab] extract change and change list viewmodels
GitOrigin-RevId: cd674535dca77ece4cc84584e6246ac648c61e52
2023-07-25 15:38:28 +00:00
Ivan Semenov
bec9a8c6bf [collab/git/gitlab] extract changes utilities
GitOrigin-RevId: b5c2e02485eab8d18b83530ccac20fd3036b49e3
2023-07-25 15:38:28 +00:00
Ivan Semenov
09e1e85f50 [gitlab] fix event ordering
GitOrigin-RevId: 2fddd333fbfa197effe5009ba7f9713410012869
2023-07-25 15:38:28 +00:00
Ivan Semenov
723dec48ad [collab/gitlab] extract function
GitOrigin-RevId: 16b2a06b880e3fa26dcc684aa2fbe13233141d44
2023-07-25 15:38:28 +00:00
Ivan Semenov
2b4a5d3a73 [collab/gitlab] extract lazy review list scrollpane wrapper
GitOrigin-RevId: 7b5d7c29f747cad1fbbfc723b77b3449c169b6e6
2023-07-25 15:38:28 +00:00
Ivan Semenov
18aabd54ea [collab/gitlab] do not convert GQL errors into json errors
GitOrigin-RevId: 9589aeca8ba4de4f75c4799411f3667066354998
2023-07-24 11:28:00 +00:00
Pavel Gromov
d4a68b059f [gitlab] Cancel submit popup scope on close (IDEA-325298, IDEA-325368)
GitOrigin-RevId: aa04166d58e76def30dcef79b88958b762247d14
2023-07-20 19:50:27 +00:00
Pavel Gromov
e30fe7cfca [gitlab] Reload MR after REST API actions (IDEA-325367)
GitOrigin-RevId: 93df3aaad837b764550730a08b85e61965db7c30
2023-07-20 19:50:26 +00:00
Ivan Semenov
1870315023 [gitlab] provide service via VM constructor
GitOrigin-RevId: 837708f2133630dbe2bcab1242d8718438bec3fe
2023-07-20 11:11:16 +00:00
Ivan Semenov
7824d3d8ac [gitlab] hide implementation details
GitOrigin-RevId: 0f7575001038b6c08b166e1273b46e6158b96718
2023-07-20 11:11:16 +00:00
Ivan Semenov
e1d2d27211 [gitlab] move MR diff VM creation to project VM
GitOrigin-RevId: 392bb81ecd9c3d4922ad3380d0bacd37d9e7ddde
2023-07-20 11:11:16 +00:00
Ivan Semenov
0f4c8ca760 [gitlab] move MR details VM infra from component factory
GitOrigin-RevId: ac9d71ac6ac3f606370546d7467556889a69f69c
2023-07-20 11:11:16 +00:00
Ivan Semenov
93b84117ac [gitlab] create MR timeline VM in MR project VM
GitOrigin-RevId: 64b18d8a83234a9cac4d21dde0e26dc471183bc9
2023-07-20 11:11:16 +00:00
Ivan Semenov
96b331d979 [gitlab] create MR selectorVM in toolwindowVM
GitOrigin-RevId: 08297683f44b61c03cec45e1a97c553731545508
2023-07-20 11:11:16 +00:00
Ivan Semenov
db529412ca [gitlab] remove required modality for closing MR files
GitOrigin-RevId: 637d19863f2f6089cd9737eb9c7229477c0950cc
2023-07-20 11:11:16 +00:00
Ivan Semenov
7aa8ade50c [gitlab] show loading label immediately
GitOrigin-RevId: 6bc00acbd0537be85a505d5769c4f6f7793020f6
2023-07-20 11:11:15 +00:00
Pavel Gromov
d479a12903 [gitlab] Fix request reviewer action: compare users by id (IDEA-325307)
GitOrigin-RevId: b269a7ee0682a594d2df4baf060f2c8a10b55a8c
2023-07-18 20:26:41 +00:00
Pavel Gromov
ff2296a0c7 [gitlab] Update MR after submitting review (IDEA-324203)
GitOrigin-RevId: f01f6e537e2518ef85ef98b4b9a475ddf4a8abe5
2023-07-18 20:26:41 +00:00