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

EES-5656 Publishing change #5474

Merged
merged 16 commits into from
Dec 20, 2024

Conversation

benoutram
Copy link
Collaborator

@benoutram benoutram commented Dec 18, 2024

This PR follows up the changes already made for EES-5656 in #5455.

It also builds upon #5426 which removed IReleaseVersionRepository.ListLatestReleaseVersions(CancellationToken cancellationToken) which returned release versions in reverse chronological order for User Management pages.

Now on publishing a release version, we change the LatestPublishedReleaseVersionId of a publication based on the publication's release series. If the release version being published is within the same release as the latest release in the series then we will replace the LatestPublishedReleaseVersionId with the current one being published. If the release version being published is not within the same release then it's left unchanged.

This replaces the previous behaviour which replaced the value if the release version belonged to the publication's latest release in reverse chronological order according to time period and year.

It updates methods IReleaseVersionRepository.GetLatestReleaseVersion to use the latest release in the release series when determining the latest version, and IReleaseVersionRepository.ListLatestReleaseVersions to use the release series to order the release versions by.

Other changes

  • Remove IReleaseVersionRepository.GetLatestPublishedRelease(Guid publicationId) - This method which previously calculated the latest release version of a publication's latest release in reverse chronological order according to time period and year is removed in favour of using Publication.LatestPublishedReleaseVersion directly.

  • Consolidated methods IReleaseVersionRepository.ListLatestReleaseVersionIds/ListLatestPublishedReleaseVersionIds and IReleaseVersionRepository.ListLatestReleaseVersions/ListLatestPublishedReleaseVersions with new publishedOnly flag.

UI test report

image

@benoutram benoutram changed the base branch from dev to EES-5656_Release_Series_Change December 18, 2024 09:02
Copy link
Collaborator

@jack-hive jack-hive left a comment

Choose a reason for hiding this comment

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

Great work! Can't spot anything too out of place. Only jotted a few things down. I've not ran the tests or checked if it builds or anything.

@@ -469,11 +471,11 @@ public async Task Success()

var result = await repository.ListLatestReleaseVersionIds(publication.Id, publishedOnly: PublishedOnly);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if it would be better to create a private method ListLatestReleaseVersionIds, that feeds a value of false for the publishedOnly parameter into the method call, rather than storing the publishedOnly parameter in a class constant.

so you call it like var result = await ListLatestReleaseVersionIds(repository, publication.Id), and you can forget about the publishedOnly flag.

Similar for the other test classes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seems like a good suggestion to reduce the number of mentions of the flag, so I made this change!

I did notice though that it's really easy to accidently do something like this, using the default publishedOnly = false

await repository.ListLatestReleaseVersionIds, publication.Id)

when we intend to always do something like this now

await ListLatestReleaseVersionIds(repository, publication.Id)

@benoutram benoutram force-pushed the EES-5656_Publishing_Change branch 2 times, most recently from 43eab57 to 5adfaca Compare December 19, 2024 16:30
@benoutram benoutram requested a review from jack-hive December 19, 2024 16:37
@benoutram benoutram force-pushed the EES-5656_Publishing_Change branch from e6a4d96 to 1fb1808 Compare December 19, 2024 17:45
@benoutram benoutram force-pushed the EES-5656_Publishing_Change branch from 1fb1808 to ca6b0f7 Compare December 20, 2024 09:42
@benoutram benoutram force-pushed the EES-5656_Release_Series_Change branch from 2634134 to 9787a3d Compare December 20, 2024 11:20
…l to not use method ListLatestPublishedReleaseVersions
…blishedReleaseVersionIds and ListLatestReleaseVersions/ListLatestPublishedReleaseVersions with new publishedOnly flag.
…ersion for publication based on the latest release with a published version
…ods to use release series when working out the latest published release version of publication
@benoutram benoutram force-pushed the EES-5656_Publishing_Change branch from ca6b0f7 to 9412715 Compare December 20, 2024 13:28
@benoutram benoutram merged commit cf1747a into EES-5656_Release_Series_Change Dec 20, 2024
2 checks passed
@benoutram benoutram deleted the EES-5656_Publishing_Change branch December 20, 2024 13:30
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