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

Consolidate branch merging into Branch objects to maintain consistent unmerged status information #1028

Merged
merged 92 commits into from
Dec 7, 2022

Conversation

nelsonni
Copy link
Member

@nelsonni nelsonni commented Dec 7, 2022

Description:

Consolidate branch merging information into Branch object, instead of Metafile object, and maintain unmerged status for files even when conflicting chunks are resolved. Consistent state allows Button components to be correctly hidden when their actions are unavailable.

This PR resolves #969, and signifies the following version changes (per Semantic Version):

  • MINOR version increase

Changes:

This PR makes the following changes:

Checklist:

Before submitting this PR, I have verified that my code:

  • Resides on a fix/ or feature/ branch that was initially branched off from development.
  • Passes code linting (yarn lint) and unit testing (yarn test).
  • Successfully builds a distribution package (yarn package).
  • I have read and am aware of the CONTRIBUTING guide for this project.
  • My name is listed in the Contributors section, or this PR includes a request to add my name.

…le 'revertChanges' async thunk for metafiles
…tenerMiddleware already handles filebased and versioned updates
…n status on hover of FileComponent in Explorer cards
…asedMetafile since conflict metafiles might not be populated with a content field
…onedMetafile since worktreeStatus is capable of detecting unmerged status
…t status (Branch objects handle merging now)
@nelsonni nelsonni added bug Bug reports or bug fixes feature Feature requests or improvements dependencies Issues or updates to dependency files labels Dec 7, 2022
@nelsonni nelsonni merged commit a467a5e into main Dec 7, 2022
@nelsonni nelsonni deleted the bugfix/resolveMergeButton branch December 7, 2022 05:12
nelsonni added a commit that referenced this pull request Dec 7, 2022
…nt `unmerged` status information (#1028)

* Generalize listening for all (instead of selected) rejected actions in listenerMiddleware

* Fixes for regex patterns to handle branch comparisons and entry formats in worktreeStatus command

* Throw console.error if file-only FSCache observes an unlinkDir event

* FSCache updates to track card UUIDs in 'reserved' instead of metafile UUIDs

* Update status of all modified sub-files when calling worktreeStatus in updateVersionedMetafile command

* Remove unnecessary imports

* Rebuild yarn.lock

* Resolve absolute paths based on repository root when filtering worktreeStatus entries in fileStatus command

* Observe updated metafile for each update step when listening to cardAdded or cardUpdated actions

* Translate 'uncommitted' branch status into '*modified' on directories for fileStatus command

* Combine 'revertStagedChanges' and 'revertUnmergedChanges' into a single 'revertChanges' async thunk for metafiles

* Fix newline parsing error in JSDoc block comments

* Convert namespace import to named imports for slices/metafiles

* Remove useEffect for hydrating child metafiles in Directory since listenerMiddleware already handles filebased and versioned updates

* Reset all unstaged, staged, and unmerged files using 'revertChanges' thunk in ResetButton

* Expand StyledTreeComponent to include a onHoverText for adding version status on hover of FileComponent in Explorer cards

* Filter by git status instead of conflicts array in selectByConflicted selector

* ConflictManagerReverse component for displaying UUID, Path, Update, Repo, Status, and Branch fields

* Updated listenerMiddleware for card additions/updates/removals that impact FSCache subscriptions

* Log action.meta fields in rejected async thunk actions observed by listenerMiddleware

* Populate branch field to align ConflictManager metafile types at creation and response callsites

* Filter conflicting metafiles by handler type instead of using isFilebasedMetafile since conflict metafiles might not be populated with a content field

* Metafile 'loading' field renamed to 'flags' and extracted into Flag type

* Transition to using the nullish coalescing operator (??) from TS 3.7

* GitStatus filters for staged/unstaged/conflicted consolidated into utils

* Branch motif colors expanded to indicate branches with merge conflicts

* Check branch status in updateBranch thunk

* Badge component to display number of conflicting chunks in Card components containing textual content

* Remove redundant check for unmerged conflict metafiles in updateVersionedMetafile since worktreeStatus is capable of detecting unmerged status

* Update metafile with new code content using nullish coalescing operator (??) from TS 3.7

* Remove redundant updateBranch call during merge since updateBranches now calls updateBranch internally

* Rename utils.isConflicted to isUnmerged to indicate that unmerged status differs from containing conflicting chunks

* Await updateBranches immediately upon Refresh button click event

* Extract regex patterns for conflicting chunks into utils.getConflictingChunks

* Check for conflicting chunks when determining if conflicted motif should be returned in getSourceMotif since status can change while chunks remain in content

* JSDoc @returns type for flattenArray and flattenObject

* symmetrical fn for partitioning two arrays into symmetrical differences and intersection subarrays

* updateVersionedMetafile thunk updates descendants for directory parameter metafiles

* selectByConflicted selector expanded to differentiate metafiles based on branches

* JSDoc @returns type for diff

* JSDoc @returns type for useMap

* JSDoc @returns type for usePrevious

* Newline after description in JSDoc block

* JSDoc @returns types and newlines after description blocks for immutables fns

* Newline after description in JSDoc blocks and adhering to jsdoc/multiline-blocks rule

* JSDoc @param and @returns types for createState and mockStore

* JSDoc comments clarified to indicate listeners that match on async thunk actions

* Fix listener updates for fulfilled Metafile async thunk update actions to use updated versions of underlying metafile

* Rename isUnstaged() to isModified() to more accurately reflect a modified, but not staged status

* Update conflicts field during onChange event in Editor

* Remove unused import withStyles

* All Button components updated to prevent propogating click events to parent components

* Refresh button component for updating filebased and versioned metafile fields

* BranchRibbon component responds to conflicts by changing text and background colors

* Add `electron-devtools-installer` package to devDependencies to auto install DevTool extensions into Electron

* Enable `redux-devtools` module in Electron app

* Remove unused module.exports.fallback imports

* Remove `plugin:import/electron` and use`settings.import/modules: ["electron"]` instead

* Standardized quotes in jest.config.js moduleNameMapper

* Updated ARCHITECTURE for changes to import packages and TS/ESLint/Jest/RTL configs

* ConflictManager card component removed, conflicts managed directly in Explorer card component

* Add `enabled` prop for enabling/disabling Button components during render

* Remove listener checks for deprecated `ConflictManager` metafile types

* Allow multiple astericks in JSDoc comments for Markdown bullet lists

* Fix overflowing card-header when title is long

* New Metadata component for a standardized table view of Metafile contents on the back of cards

* BranchList component simplified and migrated into Branches component tree

* BranchRibbon component simplified and migrated into Branches component tree

* JSDoc comments for Branches component

* BranchItem component allows highlights for indicating the current branch of a parent card, metafile, or list

* BranchesView button component for selecting Branches view on the back of cards

* Migrating Card components to use Metadata component on reverse

* Editor code content switched to pass-through from Metafile content property

* Updated ref to BranchRibbon component

* Updated jsdoc/no-multi-astericks rule format

* removeObjectProperty function added for immutably removing properties in a typesafe manner

* worktreeStatus checks for in-progress merges and returns 'unmerged' if found

* Branch objects expanded to include merging field when a branch is the base of an in-progress merge

* Metafile object no longer differentiates merging status, only conflict status (Branch objects handle merging now)

* BranchRibbon indicates unmerged based on branch.status instead of conflicted metafile count

* Abort button enable via checks against merging branches instead of merging metafiles

* Resolve button simplified to key off of merging branches in Explorer metafiles

* Stage button checks for unstaged metafiles based on unmerged status instead of modified status

* Remove unused isAbortable import

* Metadata component checks for merging branches instead of merging metafiles

* MergeDialog modal component checks for merging branches and updates accordingly

* fetchMergingBranches checks for the existence of MERGE_MSG file before attempting to read

* Remove unused SHA1 type import

* Always enable Redux DevTools integration

* Mock git-status for all fetchBranch tests that intrinsically check branch status

* Mock git-status for all updateVersionedMetafile tests that intrinsically check branch status

* Partial removal of strict RootState typing on useAppSelector usage
nelsonni added a commit that referenced this pull request Dec 7, 2022
…nt `unmerged` status information (#1028)

* Generalize listening for all (instead of selected) rejected actions in listenerMiddleware

* Fixes for regex patterns to handle branch comparisons and entry formats in worktreeStatus command

* Throw console.error if file-only FSCache observes an unlinkDir event

* FSCache updates to track card UUIDs in 'reserved' instead of metafile UUIDs

* Update status of all modified sub-files when calling worktreeStatus in updateVersionedMetafile command

* Remove unnecessary imports

* Rebuild yarn.lock

* Resolve absolute paths based on repository root when filtering worktreeStatus entries in fileStatus command

* Observe updated metafile for each update step when listening to cardAdded or cardUpdated actions

* Translate 'uncommitted' branch status into '*modified' on directories for fileStatus command

* Combine 'revertStagedChanges' and 'revertUnmergedChanges' into a single 'revertChanges' async thunk for metafiles

* Fix newline parsing error in JSDoc block comments

* Convert namespace import to named imports for slices/metafiles

* Remove useEffect for hydrating child metafiles in Directory since listenerMiddleware already handles filebased and versioned updates

* Reset all unstaged, staged, and unmerged files using 'revertChanges' thunk in ResetButton

* Expand StyledTreeComponent to include a onHoverText for adding version status on hover of FileComponent in Explorer cards

* Filter by git status instead of conflicts array in selectByConflicted selector

* ConflictManagerReverse component for displaying UUID, Path, Update, Repo, Status, and Branch fields

* Updated listenerMiddleware for card additions/updates/removals that impact FSCache subscriptions

* Log action.meta fields in rejected async thunk actions observed by listenerMiddleware

* Populate branch field to align ConflictManager metafile types at creation and response callsites

* Filter conflicting metafiles by handler type instead of using isFilebasedMetafile since conflict metafiles might not be populated with a content field

* Metafile 'loading' field renamed to 'flags' and extracted into Flag type

* Transition to using the nullish coalescing operator (??) from TS 3.7

* GitStatus filters for staged/unstaged/conflicted consolidated into utils

* Branch motif colors expanded to indicate branches with merge conflicts

* Check branch status in updateBranch thunk

* Badge component to display number of conflicting chunks in Card components containing textual content

* Remove redundant check for unmerged conflict metafiles in updateVersionedMetafile since worktreeStatus is capable of detecting unmerged status

* Update metafile with new code content using nullish coalescing operator (??) from TS 3.7

* Remove redundant updateBranch call during merge since updateBranches now calls updateBranch internally

* Rename utils.isConflicted to isUnmerged to indicate that unmerged status differs from containing conflicting chunks

* Await updateBranches immediately upon Refresh button click event

* Extract regex patterns for conflicting chunks into utils.getConflictingChunks

* Check for conflicting chunks when determining if conflicted motif should be returned in getSourceMotif since status can change while chunks remain in content

* JSDoc @returns type for flattenArray and flattenObject

* symmetrical fn for partitioning two arrays into symmetrical differences and intersection subarrays

* updateVersionedMetafile thunk updates descendants for directory parameter metafiles

* selectByConflicted selector expanded to differentiate metafiles based on branches

* JSDoc @returns type for diff

* JSDoc @returns type for useMap

* JSDoc @returns type for usePrevious

* Newline after description in JSDoc block

* JSDoc @returns types and newlines after description blocks for immutables fns

* Newline after description in JSDoc blocks and adhering to jsdoc/multiline-blocks rule

* JSDoc @param and @returns types for createState and mockStore

* JSDoc comments clarified to indicate listeners that match on async thunk actions

* Fix listener updates for fulfilled Metafile async thunk update actions to use updated versions of underlying metafile

* Rename isUnstaged() to isModified() to more accurately reflect a modified, but not staged status

* Update conflicts field during onChange event in Editor

* Remove unused import withStyles

* All Button components updated to prevent propogating click events to parent components

* Refresh button component for updating filebased and versioned metafile fields

* BranchRibbon component responds to conflicts by changing text and background colors

* Add `electron-devtools-installer` package to devDependencies to auto install DevTool extensions into Electron

* Enable `redux-devtools` module in Electron app

* Remove unused module.exports.fallback imports

* Remove `plugin:import/electron` and use`settings.import/modules: ["electron"]` instead

* Standardized quotes in jest.config.js moduleNameMapper

* Updated ARCHITECTURE for changes to import packages and TS/ESLint/Jest/RTL configs

* ConflictManager card component removed, conflicts managed directly in Explorer card component

* Add `enabled` prop for enabling/disabling Button components during render

* Remove listener checks for deprecated `ConflictManager` metafile types

* Allow multiple astericks in JSDoc comments for Markdown bullet lists

* Fix overflowing card-header when title is long

* New Metadata component for a standardized table view of Metafile contents on the back of cards

* BranchList component simplified and migrated into Branches component tree

* BranchRibbon component simplified and migrated into Branches component tree

* JSDoc comments for Branches component

* BranchItem component allows highlights for indicating the current branch of a parent card, metafile, or list

* BranchesView button component for selecting Branches view on the back of cards

* Migrating Card components to use Metadata component on reverse

* Editor code content switched to pass-through from Metafile content property

* Updated ref to BranchRibbon component

* Updated jsdoc/no-multi-astericks rule format

* removeObjectProperty function added for immutably removing properties in a typesafe manner

* worktreeStatus checks for in-progress merges and returns 'unmerged' if found

* Branch objects expanded to include merging field when a branch is the base of an in-progress merge

* Metafile object no longer differentiates merging status, only conflict status (Branch objects handle merging now)

* BranchRibbon indicates unmerged based on branch.status instead of conflicted metafile count

* Abort button enable via checks against merging branches instead of merging metafiles

* Resolve button simplified to key off of merging branches in Explorer metafiles

* Stage button checks for unstaged metafiles based on unmerged status instead of modified status

* Remove unused isAbortable import

* Metadata component checks for merging branches instead of merging metafiles

* MergeDialog modal component checks for merging branches and updates accordingly

* fetchMergingBranches checks for the existence of MERGE_MSG file before attempting to read

* Remove unused SHA1 type import

* Always enable Redux DevTools integration

* Mock git-status for all fetchBranch tests that intrinsically check branch status

* Mock git-status for all updateVersionedMetafile tests that intrinsically check branch status

* Partial removal of strict RootState typing on useAppSelector usage
@nelsonni nelsonni self-assigned this Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports or bug fixes dependencies Issues or updates to dependency files feature Feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolve Merge button always throws fatal: There is no merge in progress (MERGE_HEAD missing). error
1 participant