Errors in merging pr

Hello devs, I am facing a challenge in my PR. Is there any documentation to aid in pushing the PR maybe I am missing something GitHub - Bahati308/OpenELIS-Global-2: OpenELIS 2.X is a rewrite of the original OpenELIS global with updated components and technology

think these are the errors preventing the merge
Screenshot from 2024-09-24 17-40-01

1 Like

Formating the Source code after making changes

  • After making UI changes to the frontend directory , run the formatter to properly format the Frontend code
cd frontend
npm run format

After making changes to the backend directory, run the formatter to properly format the Java code

mvn spotless:apply

thanks @Agaba_Derrick_Junior , do i need to run the command for back-end too even if I didnt make changes to it, cause I did run that of front-end. And there are no changes to add or commit in my local forked branch. Lemme re-run it and see

2 Likes

Hey

The immediate CI failure is due to an unresolved merge conflict in Header.js (those <<<<<<<, =======, >>>>>>> markers).

But just removing them is not enough

What’s likely happening

When the develop branch was merged into darkmode-2, both branches modified the same area. So:

  • One side added dark mode logic

  • The other side added different state/logic

If you just delete conflict markers without carefully merging, you might:

  • Break functionality

  • Introduce runtime errors

  • Still fail CI later (build/tests)


Proper way to fix it

  1. Open:
src/components/layout/Header.js

  1. Look at BOTH sides of the conflict:
<<<<<<< darkmode-2
// dark mode logic
=======
/ other changes (e.g. headerLogoUrl state)
>>>>>>> develop

  1. Understand what each side is doing, then merge correctly:
  • Keep both if needed

  • Avoid duplicate or conflicting logic

  • Make sure hooks/imports are valid


Then verify locally

Run:

npm install
npm run lint
npx prettier . --write
npm run build

Check if UI works (especially header + dark mode)


Important

This PR is currently failing not just because of formatting, but because:

  • The code is syntactically broken

  • And may also be logically inconsistent after merge


Tip

After fixing, always do:

git pull origin develop

before pushing again to avoid repeated conflicts.


If you want, I can help you merge that exact block correctly :+1:

1 Like