Skip to content

[SCM-914] Introduce properly typed last modified date#193

Merged
kwin merged 4 commits into
masterfrom
feature/expose-last-modified-date
Apr 8, 2024
Merged

[SCM-914] Introduce properly typed last modified date#193
kwin merged 4 commits into
masterfrom
feature/expose-last-modified-date

Conversation

@kwin

@kwin kwin commented Feb 9, 2024

Copy link
Copy Markdown
Member

Populate it with SVN, Git and JGit for now

@kwin kwin requested a review from michael-o February 9, 2024 16:15

@michael-o michael-o left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would use rather Instant. Client code needs to convert to an offset or timezone if required. We should store it neutral.

@kwin

kwin commented Feb 11, 2024

Copy link
Copy Markdown
Member Author

I would use rather Instant. Client code needs to convert to an offset or timezone if required. We should store it neutral.

That would have the disadvantage that the original offset information gets lost. Although for most operations the normalized Instant is enough there might be edge cases where the offset might be interesting. Both Git and Subversion keep the offset as well (and don’t just emit UTC dates)

@michael-o

Copy link
Copy Markdown
Member

I would use rather Instant. Client code needs to convert to an offset or timezone if required. We should store it neutral.

That would have the disadvantage that the original offset information gets lost. Although for most operations the normalized Instant is enough there might be edge cases where the offset might be interesting. Both Git and Subversion keep the offset as well (and don’t just emit UTC dates)

Subversion does not. It stores Zulu in svn:date and then coverts to your time zone. Only Git stores, for a reason I don't understand, the offset to the Unix timestamp.

@kwin kwin force-pushed the feature/expose-last-modified-date branch 2 times, most recently from ca278a9 to 16b83d0 Compare February 12, 2024 08:15
@kwin kwin force-pushed the feature/expose-last-modified-date branch from 16b83d0 to a7cf6e9 Compare February 12, 2024 15:49
@michael-o michael-o self-requested a review February 12, 2024 15:52
Comment thread maven-scm-api/src/main/java/org/apache/maven/scm/command/info/InfoItem.java Outdated
@kwin kwin force-pushed the feature/expose-last-modified-date branch 4 times, most recently from 6ba25bc to 27d69fe Compare March 27, 2024 18:46
@kwin kwin marked this pull request as ready for review March 27, 2024 18:46
@kwin kwin requested a review from michael-o March 27, 2024 18:50
@kwin kwin force-pushed the feature/expose-last-modified-date branch 2 times, most recently from 0081827 to 9b182ff Compare March 27, 2024 18:55

@michael-o michael-o left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you double check the failing CI tests?

@kwin

kwin commented Mar 28, 2024

Copy link
Copy Markdown
Member Author

It only fails on Windows. I don’t have a VM or computer at hand and the logs from CI are not verbose enough for me. @michael-o Do you have a Windows machine where you could check?

@michael-o

Copy link
Copy Markdown
Member

It only fails on Windows. I don’t have a VM or computer at hand and the logs from CI are not verbose enough for me. @michael-o Do you have a Windows machine where you could check?

Yes, I will run it locally.

@michael-o

Copy link
Copy Markdown
Member

I can reproduce the error locally. Let me check...

@michael-o

Copy link
Copy Markdown
Member

Output:

-------------------------------------------------------------------------------
Test set: org.apache.maven.scm.provider.git.gitexe.command.info.GitExeInfoCommandTckTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.995 s <<< FAILURE! -- in org.apache.maven.scm.provider.git.gitexe.command.info.GitExeInfoCommandTckTest
org.apache.maven.scm.provider.git.gitexe.command.info.GitExeInfoCommandTckTest.testInfoCommandFromBasedirDifferentFromWorkingCopyDirectory -- Time elapsed: 0.875 s <<< ERROR!
org.apache.maven.scm.ScmException: Exception while executing SCM command.
	at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:54)
	at org.apache.maven.scm.provider.git.AbstractGitScmProvider.executeCommand(AbstractGitScmProvider.java:257)
	at org.apache.maven.scm.provider.git.AbstractGitScmProvider.info(AbstractGitScmProvider.java:266)
	at org.apache.maven.scm.tck.command.info.InfoCommandTckTest.testInfoCommandFromBasedirDifferentFromWorkingCopyDirectory(InfoCommandTckTest.java:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:316)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:240)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:214)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:155)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
Caused by: org.apache.maven.scm.ScmException: Error while executing command.
	at org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils.execute(GitCommandLineUtils.java:159)
	at org.apache.maven.scm.provider.git.gitexe.command.info.GitInfoCommand.executeInfoCommand(GitInfoCommand.java:78)
	at org.apache.maven.scm.provider.git.gitexe.command.info.GitInfoCommand.executeCommand(GitInfoCommand.java:68)
	at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:52)
	... 34 more
Caused by: org.codehaus.plexus.util.cli.CommandLineException: Error while executing process.
	at org.codehaus.plexus.util.cli.Commandline.execute(Commandline.java:598)
	at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable(CommandLineUtils.java:128)
	at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine(CommandLineUtils.java:100)
	at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine(CommandLineUtils.java:68)
	at org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils.execute(GitCommandLineUtils.java:157)
	... 37 more
Caused by: java.io.IOException: Cannot run program "/X" (in directory "D:\Entwicklung\Projekte\maven-scm\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\scm-test\working-copy\src\main"): CreateProcess error=2, Das System kann die angegebene Datei nicht finden
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at java.lang.Runtime.exec(Runtime.java:593)
	at org.codehaus.plexus.util.cli.Commandline.execute(Commandline.java:595)
	... 41 more
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(ProcessImpl.java:453)
	at java.lang.ProcessImpl.start(ProcessImpl.java:139)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 43 more
@michael-o

Copy link
Copy Markdown
Member

cmd.exe is gone from command line:

[main] INFO org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils - Executing: /X /C git log -1 --no-merges "--format=format:%H %aI %aE %aN" -- java/Application.java

WTF?

@michael-o

Copy link
Copy Markdown
Member

Found it: The clone() method is broken in Commandline/Shell.

@michael-o michael-o self-requested a review April 7, 2024 16:41
@michael-o

Copy link
Copy Markdown
Member

This PR triggers apache/mina-sshd#282. We first need to upgrade MINA. I am working on this right now.

@kwin

kwin commented Apr 7, 2024

Copy link
Copy Markdown
Member Author

This PR triggers apache/mina-sshd#282. We first need to upgrade MINA. I am working on this right now.

How did this PR trigger this?

@michael-o

Copy link
Copy Markdown
Member

This PR triggers apache/mina-sshd#282. We first need to upgrade MINA. I am working on this right now.

How did this PR trigger this?

Not intentionally, I didn't notice it before. As it seems it is also present on master.

@michael-o michael-o self-requested a review April 7, 2024 20:14
@asfgit asfgit force-pushed the feature/expose-last-modified-date branch from 914dd6f to 4343fb9 Compare April 7, 2024 20:35

@michael-o michael-o left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As soon as CI passes this is good to merge.

@jira-importer

Copy link
Copy Markdown

Resolve #1134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants