Skip to content

Commit

Permalink
Code review cleanup for dynamic migration/index
Browse files Browse the repository at this point in the history
  • Loading branch information
craigtaverner committed Jun 2, 2022
1 parent 51a3fe0 commit 8ae4c50
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void executeTask() throws IOException {
);

LOGGER.info("Updating migration/index...");
MigrateIndexGenerator.update(
MigrationIndexGenerator.update(
getMinorVersions(versions),
this.migrationIndexTemplate.get().getAsFile(),
this.migrationIndexFile.get().getAsFile()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;

import static java.util.Comparator.reverseOrder;
Expand All @@ -23,7 +27,7 @@
* This class ensures that the migrate/index page has the appropriate anchors and include directives
* for the current repository version.
*/
public class MigrateIndexGenerator {
public class MigrationIndexGenerator {

static void update(Set<MinorVersion> versions, File indexTemplate, File indexFile) throws IOException {
try (FileWriter indexFileWriter = new FileWriter(indexFile)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,4 @@
[[breaking-changes]]
= Migration guide

This section discusses the changes that you need to be aware of to migrate
your application to {version}. For more information about what's new in this
release, see the <<release-highlights>> and <<es-release-notes>>.

As {es} introduces new features and improves existing ones, the changes
sometimes make older settings, APIs, and parameters obsolete. We typically
deprecate obsolete functionality as part of a release. If possible, we support
the deprecated functionality for several subsequent releases before removing it.
This enables applications to continue working unchanged while you prepare to
migrate away from the deprecated functionality.

To get the most out of {es} and facilitate future upgrades, we strongly
encourage migrating away from using deprecated functionality as soon as
possible.

To give you insight into what deprecated features you're using, {es}:

- Returns a `Warn` HTTP header whenever you
submit a request that uses deprecated functionality.
- <<deprecation-logging, Logs deprecation warnings>> when
deprecated functionality is used.
- <<migration-api-deprecation, Provides a deprecation info API>>
that scans a cluster's configuration
and mappings for deprecated functionality.

For more information about {minor-version},
see the <<release-highlights>> and <<es-release-notes>>.
For information about how to upgrade your cluster, see <<setup-upgrade>>.
include::migration_intro.asciidoc[]

<% versions.each { print "* <<migrating-${ it },Migrating to ${ it }>>\n" } %>

<% includeVersions.each { print "include::migrate_${ it }.asciidoc[]\n" } %>
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ public void getVersions_includesCurrentVersion() {
}

/**
* Check that when deriving a lit of major.minor versions from git tags, the current unreleased version is included.
* Check that when deriving a list of major.minor versions from git tags, the current unreleased version is included,
* but any higher version numbers are not.
*/
@Test
public void getMinorVersions_includesCurrentButNotFutureVersions() {
Expand Down

0 comments on commit 8ae4c50

Please sign in to comment.