Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Oct 17, 2023
2 parents 7cc223f + 17916de commit 66f556b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
9 changes: 9 additions & 0 deletions eo-maven-plugin/src/main/java/org/eolang/maven/SafeMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ abstract class SafeMojo extends AbstractMojo {
new Sticky<>(() -> Catalogs.INSTANCE.make(this.transpiled.toPath(), this.transpiledFormat))
);

/**
* The Git hash to pull objects from, in objectionary.
* If not set, will be computed from {@code tag} field.
*
* @since 0.29.6
*/
@SuppressWarnings({"PMD.ImmutableField", "PMD.UnusedPrivateField"})
private CommitHash hash;

/**
* Cached tojos.
* @checkstyle VisibilityModifierCheck (5 lines)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ private static Map<String, CommitHash> fromTable(final Scalar<String> table) {
* Fake commit hashes hash-table.
*
* @since 0.29.6
* @todo #2528:30min Remove "master" pair from the table. Hash of "master" tag is not static
* and is being updated dynamically. That's why we should not use it in fake CommitHashesMap
* with {@link org.eolang.maven.objectionary.OyRemote}. That's why it would be better to remove
* it from the table and assure that all tests are green. Don't forget to remove the puzzle.
*/
public static final class Fake extends MapEnvelope<String, CommitHash> {
/**
Expand Down Expand Up @@ -130,8 +126,7 @@ public Fake() {
"9c9352890b5d30e1b89c9147e7c95a90c9b8709f 0.28.5",
"17f89293e5ae6115e9a0234b754b22918c11c602 0.28.6",
"5f82cc1edffad67bf4ba816610191403eb18af5d 0.28.7",
"be83d9adda4b7c9e670e625fe951c80f3ead4177 0.28.9",
"c28d5e7f11076c83b0ae45ae19207cdb6a992224 master"
"be83d9adda4b7c9e670e625fe951c80f3ead4177 0.28.9"
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import java.nio.file.Path;
import java.util.Map;
import org.cactoos.map.MapEntry;
import org.eolang.maven.hash.ChCached;
import org.eolang.maven.hash.ChRemote;
import org.eolang.maven.hash.CommitHash;
import org.eolang.maven.hash.CommitHashesMap;
import org.eolang.maven.log.CaptureLogs;
Expand Down Expand Up @@ -118,9 +120,10 @@ void assemblesTogether(@TempDir final Path temp) throws IOException {
}

@Test
@ExtendWith(OnlineCondition.class)
void assemblesTogetherWithVersions(@TempDir final Path temp) throws Exception {
final Map<String, CommitHash> hashes = new CommitHashesMap.Fake();
final CommitHash master = hashes.get("master");
final CommitHash master = new ChCached(new ChRemote("master"));
final CommitHash five = hashes.get("0.28.5");
final CommitHash six = hashes.get("0.28.6");
final Map<String, Path> result = new FakeMaven(temp)
Expand All @@ -142,6 +145,7 @@ void assemblesTogetherWithVersions(@TempDir final Path temp) throws Exception {
new MapEntry<>(six, new OyRemote(six))
)
)
.with("hash", master)
.execute(AssembleMojo.class)
.result();
final String stdout = "**/io/stdout";
Expand Down

1 comment on commit 66f556b

@0pdd
Copy link

@0pdd 0pdd commented on 66f556b Oct 17, 2023

Choose a reason for hiding this comment

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

Puzzle 2528-154f4f46 disappeared from eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesMap.java), that's why I closed #2541. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

Please sign in to comment.