Skip to content

Conversation

@JaroslavTulach
Copy link

Here is my attempt to backport fixes made in master since 12.2 onto release122 branch. I have executed following script:

#!/bin/bash

git log -r 12.2...origin/master java/java.lsp.server/ | grep commit | cut -f 2 -d " " | while read X; do
    git show $X --oneline | head -n 1
done

to generate all commits that touch java/java.lsp.server folder. Then I commented few merges out and got:

2ad9135514d0 Fixing typo in licenseinfo.xml.
e1ceda7c0c9d Licenseinfo for templates added.
0c290b4d9703 Generate Overrride method puts in misleading comment - fixed.
5aca5b2cc57b Make CreateElement fixes available as LSP CodeActions.
ca08952ef45f LSP: Hoover the mouse over identifier shows JavaDoc. (#2601)
b6104f59cea7 Existing CodeGenerators exposed as CodeActions via LSP. (#2587)
c9dc923f39d6 Disable 7th and 8th stage of Maven compilation test in VSNetBeans. It started to fail for unknown reason after integration.
637c7c232c97 Merge pull request #2576 from JaroslavTulach/jtulach/RobustCLI
2b9979d61e58 Merge pull request #2574 from entlicher/CorrectJavaScriptMIMEType
1e18b08852f8 VSCode: Auto import of types on code completion. (#2571)
ad38e1d7b0c7 Avoid 'Apache NetBeans Language Server not enabled\!' by ignoring StdErr when looking for match
b9049ee49c69 Inform VSCode that application/javascript is also a MIME type of JavaScript.
d01392798985 Merge pull request #2572 from entlicher/TruffleSourcesFromString
053312430951 First attempt for Java getter/setter generator for the Java LSP server.
5870c7e78f2b Display sources loaded from String and find their MIME type.
#b9a3bfb5f348 Snapshot of APIs for 12.2 (#2504)
887f6b6446a6 Merge pull request #2554 from jlahoda/fix-java.lsp.server-tests
eb4ee48877a2 Merge pull request #2549 from JaroslavTulach/TestVSCode
1c7145c144b3 Wait for build to be over before completing actions's CompletableFuture
923704569822 Wait for LanguageClient to get started before running java.compile.workspace command
234392d4fc12 Use ant -f java/java.lsp.server test-vscode-ext to execute integration tests for VSNetBeans
bcdd20ffaa5d Provide shorter evaluation error, without the unneccessary prefix.
a3101ebbb48e Fixing java/java.lsp.server tests.
#32e634b916e4 Merge NetBeans 12.2-rc3 changes to master
#b423c37f2d22 Turning on lexer.nbbridge enables Go to declaration in VSCode
c954f48dbad0 Adding support for workspace/symbol to both the LSP client and Java LSP server.
#c9d7ae811cdb Merge Apache NetBeans 12.2-rc2 changes
#54987ffb73ae Merging Apache NetBeans 12.2-rc1 changes to master.
0008febcb7c0 Enable limited DialogDisplayer emulation over LSP.
#9d6b92085dfe Merge Apache NetBeans 12.2-beta3 changes to master
#3a2cad159a2a Merge NetBeans 12.2-beta1 -> NetBeans 12.2-beta2 changes to master form the delivery branch.
#1104ec1d4832 Version bump for 12.3

then I applied the changes using this script:

#!/bin/bash
tac out | grep -v ^# | while read C M; do
    echo $C $M
    git show $C | patch -p1
    find . | grep rej$ | xargs rm
    git add .
    git status
    git commit -m "Backport of $C: $M"
done

after doing all of that the content of java/java.lsp.server is quite similar to its state in master branch (except version information):

netbeans$ git diff -r origin/master java/java.lsp.server/ | grep ^diff
diff --git a/java/java.lsp.server/nbproject/org-netbeans-modules-java-lsp-server.sig b/java/java.lsp.server/nbproject/org-netbeans-modules-java-lsp-server.sig
diff --git a/java/java.lsp.server/nbproject/project.properties b/java/java.lsp.server/nbproject/project.properties
diff --git a/java/java.lsp.server/vscode/package.json b/java/java.lsp.server/vscode/package.json

Let's see if everything builds OK. Guys, please verify your changes are in. @lkishalmi please confirm it is OK to merge into release122 - I have seen it was OK when producing 12.0-u1, so hopefully it is OK to continue pushing to release122 as well.

@matthiasblaesing
Copy link
Contributor

Just as a general hint: Taking git commits and applying them to other branches is the domain of "cherry-pick". So given the above and only looking at the first 5 entries of the list, this would be the approach I suggest:

git checkout release122
git cherry-pick 2ad9135514d0 e1ceda7c0c9d 0c290b4d9703 5aca5b2cc57b ca08952ef45f 

The benefit is, that git will take care of stopping at the right points if manual adjustments are necessary and can take history into account. In general the approach taken looks ok, but I can see situation where this breaks hard (binaries, rejects).

@neilcsmith-net
Copy link
Member

I assume akse.sh, apply.sh and out are not meant to be merged?!

The spec version increments look suspect to me. eg. would expect ide/spi.debugger.ui/manifest.mf to go from 2.65 to 2.65.1, not 2.67.1? That would take it ahead of master.

@JaroslavTulach JaroslavTulach self-assigned this Dec 31, 2020
@JaroslavTulach JaroslavTulach added the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Dec 31, 2020
@JaroslavTulach
Copy link
Author

Thanks for the New Year's Eve reviews! I'll redo the commits using git cherry-pick that shall fix the problem with *.sh scripts being incorrectly included. Versioning in this case is kind of tricky, but 2.65.1 is probably better than current state. I'll use it.

Jaroslav Tulach added 19 commits January 1, 2021 08:36
…to execute integration tests for VSNetBeans
…ed!' by ignoring StdErr when looking for match
…est in VSNetBeans. It started to fail for unknown reason after integration.
@JaroslavTulach JaroslavTulach force-pushed the BackportVSNetBeansFixes branch from a72e011 to 84d8a49 Compare January 1, 2021 07:54
@JaroslavTulach JaroslavTulach removed the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Jan 1, 2021
@JaroslavTulach
Copy link
Author

JaroslavTulach commented Jan 1, 2021

I tried to use git cherry-pick, but the result was far from good:

  • required a lot of manual conflict solving!?
  • it doesn't like merge commits
  • some files were missing at the end

As such I decided to just replay the original script and then manually adjust dependencies by increasing the 3rd digit.

@matthiasblaesing
Copy link
Contributor

matthiasblaesing commented Jan 1, 2021

Ähm - you are actively deleteing rejects:

find . | grep rej$ | xargs rm

I have some serious doubts, that that is a good idea. And the question is: If there are merge conflicts: Why are they there? Where are the differing commits?


Yes the merge commits are a problem, because cherry-pick applies the changes, but merge pulls two branches together, which branch should cherry-pick as a basis for the merge? This is the reason I like to cleanup after doing a messy PR and compress the 17 intermediate commits into one or two meaning full commits, that makes it much easier to deal with history changes like this. But you can work around that by specifying the commits from the branches you merged, that is already the case here:

887f6b6446a6 Merge pull request #2554 from jlahoda/fix-java.lsp.server-tests

merged

a3101ebbb48e Fixing java/java.lsp.server tests.

For the huge number of conflicts, I suspect the problem is, that the order of the commits is reversed. The first entry in your list is the most recent, while cherry-pick needs the "right" order or commits.

@JaroslavTulach
Copy link
Author

JaroslavTulach commented Jan 1, 2021

Re. order: My script is using tac instead of cat to reverse the order of commits. For cherrypicking I actually tried both orders - the conflicts persist. Anyway I trust my script more than any magic that comes from git cherry-pick. I really want to find all commits that touch java/java.lsp.server and apply them again on top of release122. That's exactly what the script does. The almost zero diff against java/java.lsp.server and the fact that the whole system compiles make me believe the approach isn't totally wrong.

Re. deleting .rej files: The .rej file that the script is deleting is:

diff --git a/ide/spi.debugger.ui/manifest.mf.rej b/ide/spi.debugger.ui/manifest.mf.rej
new file mode 100644
index 000000000000..5718128251a1
--- /dev/null
+++ b/ide/spi.debugger.ui/manifest.mf.rej
@@ -0,0 +1,10 @@
+--- ide/spi.debugger.ui/manifest.mf
++++ ide/spi.debugger.ui/manifest.mf
+@@ -2,6 +2,6 @@ Manifest-Version: 1.0
+ OpenIDE-Module: org.netbeans.spi.debugger.ui/1
+ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/ui/Bundle.properties
+ OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml
+-OpenIDE-Module-Specification-Version: 2.66
++OpenIDE-Module-Specification-Version: 2.67
+ OpenIDE-Module-Provides: org.netbeans.spi.debugger.ui
+ OpenIDE-Module-Install: org/netbeans/modules/debugger/ui/DebuggerModule.class

manual inspection indicates that the conflict is only in versioning. This PR's last commit (84d8a49) sets the version to 2.65.1 per Neil's suggestion.

Copy link
Contributor

@jlahoda jlahoda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I skimmed through the list of commits - seems sensible to me.

@JaroslavTulach JaroslavTulach merged commit 573f287 into apache:release122 Jan 4, 2021
@junichi11 junichi11 added this to the 12.2 milestone Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants