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

Handle merge conflicts #336

Closed
7 of 23 tasks
AnneThorseng opened this issue Nov 7, 2018 · 6 comments
Closed
7 of 23 tasks

Handle merge conflicts #336

AnneThorseng opened this issue Nov 7, 2018 · 6 comments
Assignees
Labels
area/version-control Area: Related to version control for files in apps. kind/product-feature kind/user-story Used for issues that describes functionality for our users. solution/studio/designer Issues related to the Altinn Studio Designer solution.
Milestone

Comments

@AnneThorseng
Copy link

AnneThorseng commented Nov 7, 2018

Functional architect/designer: @AnneThorseng @sarahwoodhouse
Technical architect: @TheTechArch @matsgm

Description
As a service developer I need to handle merge conflicts when the file I push to master conflicts with the master file.

  • The difference between files will be shown in Monaco as displayed from Git.
  • The service developer must choose to keep one or both changes and remove git tags.
  • When the git tags are removed, the merge conflict is solved and can be pushed to master
  • On pressing "validate" the following happens; commit changes and pull latest version from master.
  • On pressing "Behold master" the following happens; Undo all local changes on the specified file, merge conflict is solved.
  • On pressing "Forkast" the following happens; Confirmation message no.2 opens, if conformation, Undo all local changes on all file, merge conflict is solved.

(Further work on merge conflicts is relevant for post-MVP. See issue #337)

Sketch (if relevant)
https://www.figma.com/file/EG80RgF70SgMyewzKpb5fJ9M/Altinn-Studio?node-id=211%3A0

Navigation from/to (if relevant)
Navigate from and to the message boxes for merge conflicts, see issue #335.

Technical considerations

  • HandleMergeComponent will be a part of Service-Development main app.
  • Service Development "main app" will do an initial check for merge conflict when loaded, and save result to state.
  • Merge Conflict state status will limit navigation in Service Development and redirect to the "HandleMergePage".
  • HandleMergeComponent updates the state.

Acceptance criterea

  • Difference between local and master is shown in in code editor
  • if more files than max nbr (desktop 13, tablet 11, hd 20) have conflict, a scroll bar is visible
  • The merge conflict is handled when the git tags are removed
  • "Validere endringer" and "beskrivelse" is only active when all merge conflicts are solved
  • On "Validere endringer", the changes are saved locally and the user is reverted back, as described in Sync service with master in Altinn Studio #335

Validations

  • The service developer is not allowed to keep working on the service without solving the merge conflict. error message no.1 is displayed if the user tries to navigate to another page related to the service.
  • The service developer can navigate back to the dashboard and choose to work on a different service.
  • If the service developer navigates back to a service with a merge conflict, she will be re-directed to the merge conflict page.

Tasks

  • Technical implementation @TheTechArch
  • Scetches, error messages @sarahwoodhouse
  • can user leave this page without making a choice on which file to keep?

Developer tasks

FrontEnd @matsgm

  • HandleMergeComponent
    • Create the React Monaco component ( See Tamagotchi Embedded code editor #531 )
    • Create HandleMergeConflictContainer
    • Create FileList subcomponent showing files with merge conflict
      • Add/modify styles to match the different screen sizes
    • [ ] Create a "Keep master" button beside each conflicted file (on click use the endpoint "keep master")
    • Create a link for "Discard all changes/Forkast alle mine lokale endringer"
    • Create a textarea for commenting commit + validate and cancel button
  • Service-Development
    • Create initial check for merge status. (Reuse a function from HandleMergeComponent?) This will block access to all subApps until status is OK.
    • Save mergeStatus as state or store.
    • Create redirect to "/mergeconflict" if mergeConflict=true
    • Create a route "/mergeconflict" which routes directly to HandleMergeComponent and blocks all other apps. 
  • WCAG Standards
    • Keyboard navigation, contrast and Screen-Reader

- [ ] Reuse popover message for error message and revert changes message

BackEnd

  • Create API controller for fetching info about merge conflict (reuse existing controller for pulling changes?)
    • Create endpoint for discarding all changes @acn-dgopa
    • Create endpoint for 'keep master' button @acn-dgopa
    • Endpoint/API must resturn success/not success @acn-dgopa

Test / QA

  • Design Review
  • Frontend UI Tests / Jest
  • Backend Unit tests
  • Functional TestCafé tests
  • Manual testing
@AnneThorseng AnneThorseng added solution/studio/designer Issues related to the Altinn Studio Designer solution. needs-spesification kind/user-story Used for issues that describes functionality for our users. area/version-control Area: Related to version control for files in apps. labels Nov 7, 2018
@AnneThorseng AnneThorseng added this to the MVP milestone Nov 7, 2018
@AnneThorseng AnneThorseng changed the title Handle merge conflicts Handle merge conflicts at file level Nov 7, 2018
@AnneThorseng
Copy link
Author

#337

@AnneThorseng AnneThorseng modified the milestones: MVP, Sprint 21 Nov 13, 2018
@sarahwoodhouse sarahwoodhouse changed the title Handle merge conflicts at file level Handle merge conflicts Nov 22, 2018
@hannekot hannekot added status/ready-for-dev Status: Used for issues that are ready for development. Has been through grooming. and removed needs-spesification labels Nov 26, 2018
@AnneThorseng
Copy link
Author

Ført tid for Sarah og meg

@acn-dgopa
Copy link
Member

PR #744 for gitea endpoints

@sarahwoodhouse
Copy link

sarahwoodhouse commented Jan 16, 2019

Updates to issue based on new design
Changes will be inserted in description above, when possible.
Description:

  • Button "Lagre fil", is only active when a file has been altered.
  • On pressing "valider endringer" the following happens; the changes are commited and pull latest version from master. Message no.3 is shown.
    • On pressing "Del endringer"; Push to master and re-direct back to the page they came from (or the "Om-admin. page if the came from outside the service development app")
    • On pressing "Arbeid videre uten å dele endringer"; Redirect back to the page they came from (or the "Om-admin. page if the came from outside the service development app")
  • On pressing "Lagre fil" the following happens; Save the changes to the specific file and check if git tags are removed from the file. If yes, change the icon in the file list according to sketch.
  • On pressing "Avslutt uten å løse konflikt" the following happens; Confirmation message no.2 opens.
    • On pressing "Avslutt uten å løse konflikt"; git merge --abort and re-direct back to the page they came from (or the "Om-admin. page if the came from outside the service development app")
    • On pressing "Avbryt"; close message no.2.
  • ~~ On pressing "Expand"; The code window and file list expands according to text. ~~
    • Max width on file list is 360px
    • On Desktop; H1 Side title changes to H2 section title

@sarahwoodhouse
Copy link

Updated description @matsgm @acn-dgopa

Description
As a service developer I need to handle merge conflicts when the file I push to master conflicts with the master file.

  • The difference between files will be shown in Monaco as displayed from Git.
  • The service developer must choose to keep one or both changes and remove git tags.
  • When the git tags are removed, the merge conflict is solved and can be pushed to master
  • On pressing "Lagre fil" the following happens; Save the changes to the specific file and check if git tags are removed from the file. If yes, change the icon in the file list according to sketch.
    • When the last file with a solved merge conflict is saved, the following happens; The menu bars are visible and active, and message no. 4 is shown. (See sketch) The user is free to work as she please on her service.
  • On pressing "Forkast alle mine endringer" the following happens; Confirmation message no.3 opens.
    • if "Forkast alle mine endringer", Undo all local changes (git reset --hard) on all file, merge conflict is solved and re-direct back to the page they came from (or the "Om-admin. page if the came from outside the service development app")
    • On pressing "Avbryt"; close message no.2.
  • On pressing "Avslutt uten å løse konflikt" the following happens; Confirmation message no.2 opens.
    • On pressing "Avslutt uten å løse konflikt"; git merge --abort and re-direct back to the page they came from (or the "Om-admin. page if the came from outside the service development app")
    • On pressing "Avbryt"; close message no.2.
  • On pressing "Expand"; The code window and file list expands according to text.

Sketch (if relevant)
https://www.figma.com/file/EG80RgF70SgMyewzKpb5fJ9M/Altinn-Studio?node-id=211%3A0

Navigation from/to (if relevant)
Navigate from and to the message boxes for merge conflicts, see issue #335.

Technical considerations

  • HandleMergeComponent will be a part of Service-Development main app.
  • Service Development "main app" will do an initial check for merge conflict when loaded, and save result to state.
  • Merge Conflict state status will limit navigation in Service Development and redirect to the "HandleMergePage".
  • HandleMergeComponent updates the state.

Acceptance criterea

  • Difference between local and master is shown in in code editor
  • Button "Lagre fil", is only active when a file has been altered.
  • The merge conflict is handled when the git tags are removed

Validations

  • The service developer is not allowed to keep working on the service without solving the merge conflict. Hence, the menu bars ar hidden when the service has git status merge conflict.
  • The service developer can navigate back to the dashboard and choose to work on a different service.
  • If the service developer navigates back to a service with a merge conflict, she will be re-directed to the merge conflict page.

@gudrunvigerustfuru gudrunvigerustfuru removed needs-spesification status/ready-for-dev Status: Used for issues that are ready for development. Has been through grooming. labels Jan 22, 2019
@matsgm
Copy link

matsgm commented Jan 28, 2019

Issue is deployed to dev environment. Outstanding issues is available in #918
Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/version-control Area: Related to version control for files in apps. kind/product-feature kind/user-story Used for issues that describes functionality for our users. solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
None yet
Development

No branches or pull requests

8 participants