Skip to content
Snippets Groups Projects

Much Online Monitoring based on Task and Algo.

Merged Vikas Singhal requested to merge v.singhal/old_cbmroot:master into master

Converted Much Monitoring class into Task and Algo format. Histogram optimization is still pending.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @f.uhlig I created a MR for Task and Algo separation of MUCH Monitoring Class. I did the clang code formatting, though it is showing MR failed due to code formatting. Can you check and suggest why is this so?

    Thanks and regards Vikas

  • @v.singhal,

    I am not 100% sure but in my opinion the format check worked properly. At least no errors are shown on our CDash page. I am still not sure what the problem is but the job is somehow stuck.

    The real problem in case of your MR is that one of the files isn't a unix file but has somehow CRLF line endings. Please convert it properly to Unix file type using the tool dos2unix which should be installed on any Linux system.

  • @v.singhal,

    I fixed the issue and now the code format checker runs and created the proper output on CDash. The code is not properly formated. Which version of clang-format did you use? Please recheck also the instructions at

    https://redmine.cbm.gsi.de/projects/cbmroot/wiki/Clang-format

  • @f.uhlig

    I have downloaded the clang-format from provided redmine page only but I didnot format via mentioned script and procedure. I just used the below command:-

    clang-format -i

    After this I checked that code is running properly then I have committed the same and generated MR. Have I did something wrong... Vikas

  • @v.singhal,

    sure it is also okay to run clang-format manually as you did. You can check the suggested changes by our test at

    https://cdash.gsi.de/viewBuildError.php?buildid=268597

    The page is also linked from our main CDash page. There are only two files which show a problem. The first one

    create_MUCH_geometry_v20b_lmvm_start.C

    shows many needed changes, so I assume that you forgot to run clang-format on the file. The advantage of the script is that all needed files will be formatted und you can't forget one. The second file

    macro/beamtime/mcbm2020/MonitorMuchBinning.C

    shows only a problem in one line which I don't understand from the output.

    Beside these two problems there is also the mentioned file

    fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.cxx

    which has a wrong file format.

  • Vikas Singhal added 1 commit

    added 1 commit

    • ccd2a712 - Apply clang-format. Showing many changes. Do not know why.

    Compare with previous version

  • Dear @f.uhlig

    To complete this MR. I did following:-

    clone my cbmroot, ./scripts/check-apply-format-changes.sh check --> showed many changes. ./scripts/check-apply-format-changes.sh apply --> Applied

    Remembered that need to rebase first before commit (showing that behind 48 commit). after stashing did pull.

    git stash git pull --rebase git status ---> showed up to date ./scripts/check-apply-format-changes.sh check --> showed same many changes (169 files). ./scripts/check-apply-format-changes.sh apply --> Applied git commit -m"" git push

    Now at MR showing pipeline failed. I have 2 queries:-

    1: Why it showed many changes w.r.t clang format in those files which are not added/changed by me. (mostly files are from analysis/PWGC2F/femtoscopy/nicafemto/ and reco/ folder)? As I did rebase from upstream so all the files should be according to the clang format, isn't it so?

    2: Now how to proceed? If I clone from my cbmroot then already these 169 changes will be cloned. Am I missing something somewhere?

    Kindly suggest accordingly.

    Vikas

  • Hi @v.singhal,

    whatever went wrong but you did not rebase your merge request. If you check at the top of the page you are still 48 commits behind the current master branch. Your command sequence looks okay beside I am not sure from where you did the pull. If you only pulled from your fork there will be no change. Here is the sequence I do to synchronise my branch with upstream/master (upstream is the name which links to https://git.cbm.gsi.de/computing/cbmroot, could be different in your case)

    git stash (if you have some uncommitted changes)
    git fetch upstream 
    git rebase upstream/master
    git stash pop (id needed)

    Now I can check what are the differences to upstream/master

    git diff --stat upstream/master

    which should show only my changes. From here I now can apply the code formatting, commit the changes and push to my fork.

    In your case the situation is not so easy. Somehow your last commit introduced problem. I tried locally to rebase your merge request and saw tons of conflicting files. If I am correct that your last commit ccd2a712 only introduces clang-format changes as the commit message Apply clang-format. Showing many changes. Do not know why suggests, resolving the issue is not complicated.

    The first step is to get rid of the problematic commit. This is done by removing the complete commit and reseting to the previous one (77e5d5ae, Much Online Monitoring based on Task and Algo). This is done with the following command

    git reset --hard 77e5d5ae99991496e9e512819b270a34449b1431

    Since you are now in a clean situation again you can rebase

    git fetch upstream 
    git rebase upstream/master

    Checking with out formatting script I only see the following change in your code

    ./scripts/check-apply-format-changes.sh check
    Upstream name is : upstream
    Checking if there are format changes required
    warning: redirecting to https://git.cbm.gsi.de/computing/cbmroot.git/
    diff --git a/macro/beamtime/mcbm2020/MonitorMuchBinning.C b/macro/beamtime/mcbm2020/MonitorMuchBinning.C
    index 4f7df9a3..fc6702ed 100644
    --- a/macro/beamtime/mcbm2020/MonitorMuchBinning.C
    +++ b/macro/beamtime/mcbm2020/MonitorMuchBinning.C
    @@ -53,7 +53,7 @@ void MonitorMuchBinning(TString inFile           = "",
      // MUCH Gem Monitor
      // CbmMcbm2018MonitorMuch* monitorMuch = new CbmMcbm2018MonitorMuch();
      CbmMcbm2018MonitorTaskMuchLite* monitorMuch = new CbmMcbm2018MonitorTaskMuchLite();
    -  // Below Older Direct Much Monitoring Class 
    +  // Below Older Direct Much Monitoring Class
      // CbmMcbm2018MonitorMuchLite* monitorMuch = new CbmMcbm2018MonitorMuchLite();
      monitorMuch->SetHistoFileName(sHistoFile);
      //  monitorSts->SetPrintMessage();

    which looks reasonable to me.

    Please try to fix your merge request as proposed here.

  • @v.singhal

    Hi, just as a reminder, could you please try to do the steps advised by @f.uhlig ?

  • Vikas Singhal added 64 commits

    added 64 commits

    Compare with previous version

  • @f.uhlig

    I see that the reason for the failed test is again the file ending, but the CDASH summary is all green and empty. Do you think we could also upload this part to CDASH as "suggestions"?

    File fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.cxx has wrong file format
    fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.cxx: C source, ASCII text, with CRLF, LF line terminators
    Not all files have the correct file format
  • I agree that it would be better to have the information also on CDash. Unfortunately this is not so straight forward since this needs to move the code from a script to cmake.

    I have created an issue (https://redmine.cbm.gsi.de/issues/2135) as a reminder.

  • @v.singhal,

    the MR now looks much better since there are only the files which you want to commit. Unfortunately there is still a problem.

    File fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.cxx has wrong file format
    fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.cxx: C source, ASCII text, with CRLF, LF line terminators 

    Please correct the file type of the file from windows to unix using the command line tool dos2unix.

  • Vikas Singhal added 1 commit

    added 1 commit

    • a44a9787 - File Format changed for MonitorAlgoMuchLite class.

    Compare with previous version

  • Dear @f.uhlig, @p.-a.loizeau,

    you have been identified as code owner of at least one file which was changed with this merge request.

    Please check the changes and approve them or request changes.

  • Dear @f.uhlig @p.-a.loizeau

    Apology for late reply. I followed your instructions but needed 1) to use force push and also 2) to remove protection from my repository. I did both, are these OK?

    vsinghal@lxi095:~/VikasCbmRoot$ git reset --hard 77e5d5ae99991496e9e512819b270a34449b1431
    HEAD is now at 77e5d5a Much Online Monitoring based on Task and Algo.
    vsinghal@lxi095:~/VikasCbmRoot$ git fetch upstream
    vsinghal@lxi095:~/VikasCbmRoot$ git rebase upstream/master
    First, rewinding head to replay your work on top of it...
    Applying: Much Online Monitoring based on Task and Algo.
    vsinghal@lxi095:~/VikasCbmRoot$ git status
    On branch master
    Your branch and 'origin/master' have diverged,
    and have 63 and 2 different commits each, respectively.
      (use "git pull" to merge the remote branch into yours)
    nothing to commit, working directory clean
    vsinghal@lxi095:~/VikasCbmRoot$ ./scripts/check-apply-format-changes.sh check
    Upstream name is : upstream
    Checking if there are format changes required
    diff --git a/macro/beamtime/mcbm2020/MonitorMuchBinning.C b/macro/beamtime/mcbm2020/MonitorMuchBinning.C
    index 4f7df9a..fc6702e 100644
    --- a/macro/beamtime/mcbm2020/MonitorMuchBinning.C
    +++ b/macro/beamtime/mcbm2020/MonitorMuchBinning.C
    @@ -53,7 +53,7 @@ void MonitorMuchBinning(TString inFile           = "",
       // MUCH Gem Monitor
       // CbmMcbm2018MonitorMuch* monitorMuch = new CbmMcbm2018MonitorMuch();
       CbmMcbm2018MonitorTaskMuchLite* monitorMuch = new CbmMcbm2018MonitorTaskMuchLite();
    -  // Below Older Direct Much Monitoring Class 
    +  // Below Older Direct Much Monitoring Class
       // CbmMcbm2018MonitorMuchLite* monitorMuch = new CbmMcbm2018MonitorMuchLite();
       monitorMuch->SetHistoFileName(sHistoFile);
       //  monitorSts->SetPrintMessage();
    vsinghal@lxi095:~/VikasCbmRoot$ ./scripts/check-apply-format-changes.sh apply
    Upstream name is : upstream
    Applying required format changes
    Running clang-format on the following files:
        fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.cxx
        fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskMuchLite.h
        fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.h
        fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskMuchLite.cxx
        macro/beamtime/mcbm2020/MonitorMuchBinning.C
    old tree: 187da0ac481a8d611afabca9fd27344b11752693
    new tree: a050f7913b3e9f31a6aadee5bf3124ea754ed335
    changed files:
        macro/beamtime/mcbm2020/MonitorMuchBinning.C
    On branch master
    Your branch and 'origin/master' have diverged,
    and have 63 and 2 different commits each, respectively.
      (use "git pull" to merge the remote branch into yours)
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)
    
    	modified:   macro/beamtime/mcbm2020/MonitorMuchBinning.C
    
    no changes added to commit (use "git add" and/or "git commit -a")
    Next step: git add fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.cxx fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.h fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskMuchLite.cxx fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskMuchLite.h macro/beamtime/mcbm2020/MonitorMuchBinning.C
    Then     : git commit -m"Apply clang-format"
    vsinghal@lxi095:~/VikasCbmRoot$ git add fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.cxx fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoMuchLite.h fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskMuchLite.cxx fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskMuchLite.h macro/beamtime/mcbm2020/MonitorMuchBinning.C
    vsinghal@lxi095:~/VikasCbmRoot$ git status
    On branch master
    Your branch and 'origin/master' have diverged,
    and have 63 and 2 different commits each, respectively.
      (use "git pull" to merge the remote branch into yours)
    Changes to be committed:
      (use "git reset HEAD <file>..." to unstage)
    
    	modified:   macro/beamtime/mcbm2020/MonitorMuchBinning.C
    
    vsinghal@lxi095:~/VikasCbmRoot$ git commit -m"Apply clang-format"
    [master 4ccbf47] Apply clang-format
     1 file changed, 1 insertion(+), 1 deletion(-)
    vsinghal@lxi095:~/VikasCbmRoot$ git push
    Username for 'https://git.cbm.gsi.de': v.singhal
    Password for 'https://v.singhal@git.cbm.gsi.de': 
    To https://git.cbm.gsi.de/v.singhal/cbmroot.git
     ! [rejected]        master -> master (non-fast-forward)
    error: failed to push some refs to 'https://git.cbm.gsi.de/v.singhal/cbmroot.git'
    hint: Updates were rejected because the tip of your current branch is behind
    hint: its remote counterpart. Integrate the remote changes (e.g.
    hint: 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.
    vsinghal@lxi095:~/VikasCbmRoot$ 
    
    vsinghal@lxi097:~/VikasCbmRoot$ git push -f
    Username for 'https://git.cbm.gsi.de': v.singhal
    Password for 'https://v.singhal@git.cbm.gsi.de': 
    Counting objects: 657, done.
    Delta compression using up to 40 threads.
    Compressing objects: 100% (341/341), done.
    Writing objects: 100% (657/657), 213.31 KiB | 0 bytes/s, done.
    Total 657 (delta 495), reused 452 (delta 307)
    remote: Resolving deltas: 100% (495/495), completed with 182 local objects.
    remote: GitLab: You are not allowed to force push code to a protected branch on this project.To https://git.cbm.gsi.de/v.singhal/cbmroot.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.cbm.gsi.de/v.singhal/cbmroot.git'
    
    
    vsinghal@lxi097:~/VikasCbmRoot$ git push -f
    Username for 'https://git.cbm.gsi.de': v.singhal
    Password for 'https://v.singhal@git.cbm.gsi.de': 
    Counting objects: 657, done.
    Delta compression using up to 40 threads.
    Compressing objects: 100% (341/341), done.
    Writing objects: 100% (657/657), 213.31 KiB | 0 bytes/s, done.
    Total 657 (delta 495), reused 452 (delta 307)
    remote: Resolving deltas: 100% (495/495), completed with 182 local objects.
    To https://git.cbm.gsi.de/v.singhal/cbmroot.git
     + ccd2a71...6e75fdf master -> master (forced update)
    vsinghal@lxi097:~/VikasCbmRoot$ 
    
    
    

    I have also enabled "Fast Forward Merge" on my gitlab settings as per @p.-a.loizeau gitlab tutorial. Presently pipeline is running.

    Kindly update accordingly. Vikas

  • @v.singhal,

    I think now also is okay. The pipeline has finished successfully.

  • Florian Uhlig approved this merge request

    approved this merge request

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading