From 9dfd940180d5653be20fc650f63ff82ae3be282d Mon Sep 17 00:00:00 2001 From: Martin Pokorny <89339813+mPokornyETM@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:12:54 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"Reserved=20resources=20available=20ag?= =?UTF-8?q?ain=20after=20reloading=20CasC=20configuration=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 99ca947ed698860599110c8044ab253879f7362a. --- README.md | 3 ++- .../jenkins/plugins/lockableresources/LockableResource.java | 4 ++-- .../plugins/lockableresources/LockableResource/config.jelly | 3 +++ .../lockableresources/LockableResource/config.properties | 1 + .../lockableresources/LockableResource/config_cs.properties | 3 ++- .../lockableresources/LockableResource/config_de.properties | 3 ++- .../lockableresources/LockableResource/config_fr.properties | 1 + .../lockableresources/LockableResource/config_sk.properties | 3 ++- .../plugins/lockableresources/ConfigurationAsCodeTest.java | 6 ++---- .../plugins/lockableresources/casc_expected_output.yml | 1 + .../plugins/lockableresources/configuration-as-code.yml | 1 + 11 files changed, 19 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4583ce655..b93261bb4 100644 --- a/README.md +++ b/README.md @@ -305,6 +305,7 @@ unclassified: - name: "S7_1200_1" description: "S7 PLC model 1200" labels: "plc:S7 model:1200" + reservedBy: "Reserved due maintenance window" - name: "S7_1200_2" labels: "plc:S7 model:1200" - name: "Resource-with-properties" @@ -313,7 +314,7 @@ unclassified: value: "Value" ``` -Properties *description*, *labels* and *properties* are optional. +Properties *description*, *labels* and *reservedBy* are optional. ---- diff --git a/src/main/java/org/jenkins/plugins/lockableresources/LockableResource.java b/src/main/java/org/jenkins/plugins/lockableresources/LockableResource.java index ee549667b..509f8abb8 100644 --- a/src/main/java/org/jenkins/plugins/lockableresources/LockableResource.java +++ b/src/main/java/org/jenkins/plugins/lockableresources/LockableResource.java @@ -70,8 +70,8 @@ public class LockableResource extends AbstractDescribableImpl private transient String labels = null; private List labelsAsList = new ArrayList<>(); - private transient String reservedBy = null; - private transient Date reservedTimestamp = null; + private String reservedBy = null; + private Date reservedTimestamp = null; private String note = ""; /** diff --git a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config.jelly b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config.jelly index 1f7e00314..df4a099a7 100644 --- a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config.jelly +++ b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config.jelly @@ -20,6 +20,9 @@ + + + diff --git a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config.properties b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config.properties index bd6fe2fc4..29239d255 100644 --- a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config.properties +++ b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config.properties @@ -23,6 +23,7 @@ entry.name.title=Name entry.description.title=Description entry.labels.title=Labels +entry.reservedBy.title=Reserved by entry.properties.title=Properties entry.properties.add=Add Property entry.properties.delete=Delete Property \ No newline at end of file diff --git a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_cs.properties b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_cs.properties index 0fd70285e..49aae4af3 100644 --- a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_cs.properties +++ b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_cs.properties @@ -22,4 +22,5 @@ entry.name.title=Jm\u00e9no entry.description.title=Popis -entry.labels.title=Popisky \ No newline at end of file +entry.labels.title=Popisky +entry.reservedBy.title=Rezervace u\u017eivatelem \ No newline at end of file diff --git a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_de.properties b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_de.properties index cdd76fa46..ac9b11b41 100644 --- a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_de.properties +++ b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_de.properties @@ -22,4 +22,5 @@ entry.name.title=Name entry.description.title=Beschreibung -entry.labels.title=Labels \ No newline at end of file +entry.labels.title=Labels +entry.reservedBy.title=Reserviert durch \ No newline at end of file diff --git a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_fr.properties b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_fr.properties index 5e798e099..27cd33a61 100644 --- a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_fr.properties +++ b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_fr.properties @@ -23,6 +23,7 @@ entry.name.title=Nom entry.description.title=Description entry.labels.title=Libell\u00e9s +entry.reservedBy.title=R\u00e9serv\u00e9e par entry.properties.title=Propri\u00e9t\u00e9s entry.properties.add=Ajouter une propri\u00e9t\u00e9 entry.properties.delete=Supprimer une propri\u00e9t\u00e9 \ No newline at end of file diff --git a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_sk.properties b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_sk.properties index f369e6755..25fac2dec 100644 --- a/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_sk.properties +++ b/src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_sk.properties @@ -22,4 +22,5 @@ entry.name.title=Meno entry.description.title=Popis -entry.labels.title=\u0160t\u00edtky \ No newline at end of file +entry.labels.title=\u0160t\u00edtky +entry.reservedBy.title=Rezervovan\u00e9 u\u017e\u00edvate\u013eom \ No newline at end of file diff --git a/src/test/java/org/jenkins/plugins/lockableresources/ConfigurationAsCodeTest.java b/src/test/java/org/jenkins/plugins/lockableresources/ConfigurationAsCodeTest.java index 9a670936b..aec2a1e04 100644 --- a/src/test/java/org/jenkins/plugins/lockableresources/ConfigurationAsCodeTest.java +++ b/src/test/java/org/jenkins/plugins/lockableresources/ConfigurationAsCodeTest.java @@ -42,8 +42,7 @@ public void should_support_configuration_as_code() { assertEquals("Resource_A", declaredResource.getName()); assertEquals("Description_A", declaredResource.getDescription()); assertEquals("Label_A", declaredResource.getLabels()); - // not supported in JCaC - // assertEquals("Reserved_A", declaredResource.getReservedBy()); + assertEquals("Reserved_A", declaredResource.getReservedBy()); assertEquals("Note A", declaredResource.getNote()); assertEquals( @@ -55,8 +54,7 @@ public void should_support_configuration_as_code() { assertEquals("Resource_A", resource.getName()); assertEquals("Description_A", resource.getDescription()); assertEquals("Label_A", resource.getLabels()); - // not supported in JCaC - // assertEquals("Reserved_A", resource.getReservedBy()); + assertEquals("Reserved_A", resource.getReservedBy()); assertEquals("Note A", resource.getNote()); } diff --git a/src/test/resources/org/jenkins/plugins/lockableresources/casc_expected_output.yml b/src/test/resources/org/jenkins/plugins/lockableresources/casc_expected_output.yml index 0715bc116..50d19d666 100644 --- a/src/test/resources/org/jenkins/plugins/lockableresources/casc_expected_output.yml +++ b/src/test/resources/org/jenkins/plugins/lockableresources/casc_expected_output.yml @@ -3,3 +3,4 @@ declaredResources: labels: "Label_A" name: "Resource_A" note: "Note A" + reservedBy: "Reserved_A" diff --git a/src/test/resources/org/jenkins/plugins/lockableresources/configuration-as-code.yml b/src/test/resources/org/jenkins/plugins/lockableresources/configuration-as-code.yml index 6a77c7a0f..1690a7f8d 100644 --- a/src/test/resources/org/jenkins/plugins/lockableresources/configuration-as-code.yml +++ b/src/test/resources/org/jenkins/plugins/lockableresources/configuration-as-code.yml @@ -10,4 +10,5 @@ unclassified: - description: "Description_A" labels: "Label_A" name: "Resource_A" + reservedBy: "Reserved_A" note: "Note A"