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

Automatically resolved merge conflicts on push to gitea cause local changes to get lost #13188

Closed
Jondyr opened this issue Jul 18, 2024 · 2 comments · Fixed by #13544
Closed
Assignees
Labels
area/version-control Area: Related to version control for files in apps. kind/bug Used when there is a defect / something is not working as it should. solution/studio/designer Issues related to the Altinn Studio Designer solution. solution/studio/repos Issues related to the Altinn Studio Repos solution (Gitea).

Comments

@Jondyr
Copy link
Member

Jondyr commented Jul 18, 2024

Steps to reproduce:

  1. Create any merge conflict that will be automatically resolved by git. Example:
    1. New app, add a component to a page
    2. Push changes to gitea
    3. Alter the component in gitea (e.g. component-id)
    4. Commit changes in gitea
    5. Add a new component to the same page in studio designer
    6. Refresh and verify that both push and pull version control buttons have a notification
  2. Click "upload your changes", click "validate changes"
  3. A toast should appear stating that there is a conflict
  4. Verify that the local changes appear in studio designer, but not in gitea
    1. the new component is visible in studio designer, and not visible in Side1.json
    2. the changes done in gitea is visible both places

Potential cause?

If a merge conflict is automatically resolved, the merge conflict resolution page will not be shown. VersionControlButtonsContext.tsx:commitAndPushChanges:L57 checks if hasMergeConflict is true on the response of a repo pull http request, which might be false in the case of an automatic merge resolution?
Maybe an aheadBy value above 0 should indicate local changes not present on remote, and allow the user to push the changes?

screenshots

Pull http request response:

Image

Studio designer shows no local changes:

Image

Zipfile with just local changes is empty:

Image

Zipfile with whole repo is empty:

Image

@Jondyr Jondyr added kind/bug Used when there is a defect / something is not working as it should. solution/studio/repos Issues related to the Altinn Studio Repos solution (Gitea). area/version-control Area: Related to version control for files in apps. status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design. solution/studio/designer Issues related to the Altinn Studio Designer solution. labels Jul 18, 2024
@wrt95
Copy link
Contributor

wrt95 commented Aug 26, 2024

We should do a push when the automatic merge conflict is resolved in backend 😄

@Jondyr Jondyr self-assigned this Sep 3, 2024
@Jondyr Jondyr linked a pull request Sep 16, 2024 that will close this issue
4 tasks
@Jondyr Jondyr removed their assignment Sep 16, 2024
@framitdavid framitdavid assigned framitdavid and Jondyr and unassigned framitdavid Sep 17, 2024
@Jondyr Jondyr assigned framitdavid and unassigned Jondyr Sep 19, 2024
@framitdavid framitdavid assigned Jondyr and unassigned framitdavid Sep 19, 2024
@Jondyr Jondyr assigned framitdavid and unassigned Jondyr Sep 23, 2024
@wrt95 wrt95 removed the status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design. label Sep 24, 2024
@framitdavid
Copy link
Collaborator

Tested OK in dev, nice work! 👏

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/bug Used when there is a defect / something is not working as it should. solution/studio/designer Issues related to the Altinn Studio Designer solution. solution/studio/repos Issues related to the Altinn Studio Repos solution (Gitea).
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants