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

[JBEAP-27509] extending history information #720

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

spyrkob
Copy link
Collaborator

@spyrkob spyrkob commented Jul 11, 2024

Add current manifest versions to the git commit so that they can be displayed in history operations

== Overview
The channel manifest 1.1.0 adds a notion of logicalVersion to separate the version of manifest from the Maven coordinate. This change will consume the new field falling back to the Maven coordinate (physical version) if the logicalVersion is not present.
Additionally, the PR changes how the manifest version information is stored. Previously the version string visible in history information was constructed during update and stored. This make it hard for API clients that would like to display the versions of individual manifests.

== Expected results

  1. History operation on servers installed with old versions of Prospero works as previously
  2. A newly provisioned server's history contains individual manifest's version information rather than the constructed version message
  3. Installation-manger-api returns manifest version information for each history state including logical and physical version. If the commit was made before this changes, API should return commit information instead.

@spyrkob
Copy link
Collaborator Author

spyrkob commented Oct 15, 2024

@TomasHofman could you review this when you have a moment?

}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SavedState that = (SavedState) o;
return Objects.equals(hash, that.hash) && Objects.equals(timestamp, that.timestamp) && type == that.type;
return Objects.equals(manifestVersions, that.manifestVersions) && Objects.equals(hash, that.hash) && Objects.equals(timestamp, that.timestamp) && type == that.type && Objects.equals(msg, that.msg);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably not very important, but since the manifest versions are involved in the equals method, should the collection type for versions be Set, rather than List?

(Thinking purely about ordering, which I assume is generally undefined - version collections should be equal if they contain the same elements, irrespective of order. I think Set would facilitate that.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I'm going to sort the manifestVersions in the constructor. This way the ordering of the versions will be consistent in display.

Comment on lines 140 to 158
public Version(String identifier, String mavenVersion, String logicalVersion) {
this.identifier = identifier;
this.physicalVersion = mavenVersion;
this.logicalVersion = logicalVersion;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This would probably deserve a javadoc about what the logical and physical versions mean.

@TomasHofman
Copy link
Contributor

To double check if this was intended, when I run the new history command against an old installation, I think it delegates to the old impl and shows something like this:

[thofman@rama prospero]$ ./prospero history --dir wf
[d0efe823] 2024-07-12T14:37:36Z - update [file:/home/thofman/Projects/prospero/manifest.yaml::a4ff586c9fce21976f8596c53d6247e200d22cc6]
[71420b8d] 2024-07-12T14:24:54Z - install [org.wildfly.channels:wildfly::33.0.0.Beta1]

It shows "install [G:A::version]" at the first record.

Running the command against a newly created installation, it doesn't show the GA anymore, just the version:

[thofman@rama prospero]$ ./prospero history --dir wf3
[7822a809] 2024-10-16T11:27:47Z - install [34.0.0.Beta1]

@TomasHofman
Copy link
Contributor

High level question: since the original impl of the history command also shows versions of manifests, what is the intended improvement here?

@spyrkob
Copy link
Collaborator Author

spyrkob commented Oct 16, 2024

Thanks @TomasHofman I updated the description to explain the changes. Let me know if that clarifies it.

Running the command against a newly created installation, it doesn't show the GA anymore, just the version:
That's my mistake, I'll fix that thanks

To double check if this was intended, when I run the new history command against an old installation, I think it delegates to the old impl and shows something like this
Correct, the old history states (made before this change) should be displayed as before

@TomasHofman
Copy link
Contributor

OK, thanks for the explanation, I noticed the new schema version by accident but didn't know the details. Now it makes sense to me 👍 .

@spyrkob
Copy link
Collaborator Author

spyrkob commented Oct 17, 2024

Thanks @TomasHofman 👍

@spyrkob spyrkob merged commit 7383ef2 into wildfly-extras:main Oct 17, 2024
7 checks passed
@spyrkob spyrkob deleted the extend_history_info branch October 17, 2024 15:16
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.

2 participants