Skip to content
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

Universal Insomnia/Git Sync for all files (documents/collections) #5945

Merged
merged 28 commits into from Jul 5, 2023

Conversation

gatzjames
Copy link
Contributor

@gatzjames gatzjames commented May 4, 2023

changelog(New Features): Added Universal Insomnia and Git Sync for all files (Documents and Collections). It's now possible to share Design Documents with Insomnia Sync and Collections with Git Sync. It's also possible to chose and switch between method of sync (Insomnia/Git).

Highlights:

  • Share design documents with Insomnia Sync
  • Share collections with Git Sync
  • Ability to chose/switch between Git/Insomnia Sync
  • Online/Offline Indicator
  • Git sync status (changes to push/pull). No straightforward way to implement see open issue of isomorphic-git
  • git/insomnia sync provider in workspace meta
  • Cleanup inline styles
  • More testing

Notes:

  • Clients with previous version can pull Design Documents but not push to them and can only share with Git (The app will show the Git Sync Dropdown based on current heuristics).
  • The same happens for Clients with previous version that can pull Collections from Git but when opened will sync with Insomnia Sync.

Next steps:

  • When we clone the main branch is not connected to the remote.

Closes INS-2657

@gatzjames gatzjames self-assigned this May 4, 2023
@gatzjames gatzjames changed the title Spike: Design documents on Insomnia Sync Universal Insomnia/Git Sync for all files (documents/collections) Jun 2, 2023
@gatzjames gatzjames force-pushed the feat/insomnia-synced-documents branch from 8d00544 to 393d41e Compare June 2, 2023 09:40
@gatzjames gatzjames requested a review from a team June 2, 2023 11:41
@gatzjames gatzjames marked this pull request as ready for review June 2, 2023 11:41
@@ -17,6 +17,7 @@ interface GenericWorkspace<Scope extends 'design' | 'collection'> {
description: string;
certificates?: any; // deprecated
scope: Scope;
gitSync: boolean;
Copy link
Contributor

@jackkav jackkav Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use a meaningful string instead of a boolean to indicate gitSync, eg. gitUrl?
or a more meaningful name if gitSync is not just indicating the presence of a gitUrl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the logic to the workspaceMeta.gitRepositoryId which already exists 🙏

@gatzjames gatzjames force-pushed the feat/insomnia-synced-documents branch 3 times, most recently from 5f965a6 to 4fd549f Compare July 5, 2023 10:56
const vcs = useVCS({
workspaceId,
});
activeWorkspaceMeta?: WorkspaceMeta;
Copy link
Contributor

@jackkav jackkav Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused argument

Comment on lines 519 to 521
if (!workspaceMeta) {
throw new Error('Workspace meta not found');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invariant

Comment on lines 89 to 93
gitRepository?.uri &&
gitRepository?._id &&
gitStatusFetcher.state === 'idle' &&
!gitStatusFetcher.data &&
gitRepoDataFetcher.data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name this as a constant to indicate what its doing, or leave a comment

Copy link
Contributor

@jackkav jackkav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a few comments about consistency, LGTM did not test 😉

@gatzjames gatzjames force-pushed the feat/insomnia-synced-documents branch from 55c5d06 to fa9fa2c Compare July 5, 2023 14:41
@gatzjames gatzjames enabled auto-merge July 5, 2023 16:05
@gatzjames gatzjames added this pull request to the merge queue Jul 5, 2023
Merged via the queue into Kong:develop with commit 5b7f45e Jul 5, 2023
9 checks passed
@gatzjames gatzjames deleted the feat/insomnia-synced-documents branch July 5, 2023 17:05
jackkav pushed a commit to jackkav/insomnia that referenced this pull request Nov 24, 2023
…ng#5945)

* share design documents and tests with insomnia sync

* share collection and documents with insomnia/git sync

* checkpoint

* redirect when cloning (pulling) a new remote project

* backend workspace card

* redirect logic

* local changes styles

* loading indicator

* fix sync button styles

* use interval to refetch git

* open the repo modal first before switching to git sync

* use gitRepositoryId from metadata

* fix sync option update

* cleanup fetcher check

* fixes

* cleanup pull-push

* undo logo change

* clean git-vcs

* use cloud icon for insomnia sync

* cleanup card

* more cleanup

* better return type for fetchfetcher

* update git tests

* fix tests

* fix some prerelease tests

* fix cloning without an api spec

* fix some more tests that expect a file to exist

* fix lint error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants