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

Nifi 12192 #4

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ jobs:
${{ env.MAVEN_VERIFY_COMMAND }}
${{ env.MAVEN_BUILD_PROFILES }}
${{ env.MAVEN_PROJECTS }}
- name: Upload Test Reports
- name: Upload Test Results
if: success() || failure() || cancelled()
uses: actions/upload-artifact@v3
with:
name: surefire-reports-ubuntu-21
name: test-results-ubuntu-en
path: |
./**/target/surefire-reports/*.txt
./**/target/surefire-reports/*.xml
retention-days: 3
if: failure()
- name: Post Disk Usage
run: df
if: ${{ always() }}
Expand Down Expand Up @@ -239,15 +239,15 @@ jobs:
${{ env.MAVEN_VERIFY_COMMAND }}
${{ env.MAVEN_BUILD_PROFILES }}
${{ env.MAVEN_PROJECTS }}
- name: Upload Test Reports
- name: Upload Test Results
if: success() || failure() || cancelled()
uses: actions/upload-artifact@v3
with:
name: surefire-reports-macos-jp
name: test-results-macos-jp
path: |
./**/target/surefire-reports/*.txt
./**/target/surefire-reports/*.xml
retention-days: 3
if: failure()
- name: Post Disk Usage
run: df
if: ${{ always() }}
Expand Down Expand Up @@ -305,15 +305,15 @@ jobs:
${{ env.MAVEN_VERIFY_COMMAND }}
${{ env.MAVEN_BUILD_PROFILES }}
${{ env.MAVEN_PROJECTS }}
- name: Upload Test Reports
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: surefire-reports-windows-fr
name: test-results-windows-fr
path: |
./**/target/surefire-reports/*.txt
./**/target/surefire-reports/*.xml
retention-days: 3
if: failure()
- name: Post Disk Usage
run: df
if: ${{ always() }}
15 changes: 11 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ on:
push:
paths:
- '.github/workflows/integration-tests.yml'
- 'pom.xml'
- '**/*-assembly/pom.xml'
- '**/*-bom/pom.xml'
- '**/test/**/*IT.java'
- '**/test/**/*ITCase.java'
- '**/test/**/IT*.java'
pull_request:
paths:
- '.github/workflows/integration-tests.yml'
- 'pom.xml'
- '**/*-assembly/pom.xml'
- '**/*-bom/pom.xml'
- '**/test/**/*IT.java'
- '**/test/**/*ITCase.java'
- '**/test/**/IT*.java'
Expand Down Expand Up @@ -115,11 +121,12 @@ jobs:
${{ env.MAVEN_COMMAND }}
${{ env.MAVEN_BUILD_ARGUMENTS }}
${{ env.MAVEN_BUILD_EXCLUDE_PROJECTS }}
- name: Upload Troubleshooting Logs
if: failure() || cancelled()
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: ubuntu-21-failsafe-logs
name: test-results-ubuntu-21
path: |
**/target/failsafe-reports/**/*.txt
./**/target/failsafe-reports/**/*.txt
./**/target/failsafe-reports/**/*.xml
retention-days: 7
8 changes: 4 additions & 4 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ jobs:
${{ env.MAVEN_COMMAND }}
${{ env.MAVEN_RUN_ARGUMENTS }}
${{ env.MAVEN_PROJECTS }}
- name: Upload Troubleshooting Logs
if: failure() || cancelled()
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.version }}-troubleshooting-logs
name: test-results-${{ matrix.os }}-${{ matrix.version }}
path: |
nifi-system-tests/nifi-system-test-suite/target/failsafe-reports/**/*.txt
nifi-system-tests/nifi-system-test-suite/target/surefire-reports/**/*.txt
nifi-system-tests/nifi-system-test-suite/target/troubleshooting/**/*
retention-days: 7
retention-days: 7
44 changes: 44 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: test-report

on:
workflow_run:
workflows:
- ci-workflow
- integration-tests
- system-tests
types:
- completed

permissions:
contents: read
actions: read
checks: write

jobs:
report:
timeout-minutes: 30
runs-on: ubuntu-latest
name: Test Report
steps:
- uses: dorny/test-reporter@v1
with:
artifact: /test-results-(.*)/
name: Java Tests
path: '**/*.xml'
reporter: java-junit
max-annotations: '50'
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,6 @@ public class ConsumeAzureEventHub extends AbstractSessionFactoryProcessor implem
.defaultValue("$Default")
.required(true)
.build();
static final PropertyDescriptor CONSUMER_HOSTNAME = new PropertyDescriptor.Builder()
.name("event-hub-consumer-hostname")
.displayName("Consumer Hostname")
.description("DEPRECATED: This property is no longer used.")
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
.required(false)
.build();

static final PropertyDescriptor RECORD_READER = new PropertyDescriptor.Builder()
.name("record-reader")
Expand Down Expand Up @@ -291,7 +283,6 @@ public class ConsumeAzureEventHub extends AbstractSessionFactoryProcessor implem
POLICY_PRIMARY_KEY,
USE_MANAGED_IDENTITY,
CONSUMER_GROUP,
CONSUMER_HOSTNAME,
RECORD_READER,
RECORD_WRITER,
INITIAL_OFFSET,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@
import org.apache.nifi.util.ReflectionUtils;
import org.apache.nifi.util.ThreadUtils;
import org.apache.nifi.util.file.classloader.ClassLoaderUtils;
import org.springframework.scheduling.support.CronExpression;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.support.CronExpression;

import java.lang.management.ThreadInfo;
import java.lang.reflect.InvocationTargetException;
Expand Down Expand Up @@ -1111,7 +1111,6 @@ protected Collection<ValidationResult> computeValidationErrors(final ValidationC
}

@Override
@SuppressWarnings("deprecation")
public List<ValidationResult> validateConfig() {

final List<ValidationResult> results = new ArrayList<>();
Expand Down Expand Up @@ -2078,9 +2077,9 @@ public void onConfigurationRestored(final ProcessContext context) {
}

@Override
public void migrateConfiguration(final ControllerServiceFactory serviceFactory) {
public void migrateConfiguration(final Map<String, String> rawPropertyValues, final ControllerServiceFactory serviceFactory) {
try {
migrateProperties(serviceFactory);
migrateProperties(rawPropertyValues, serviceFactory);
} catch (final Exception e) {
LOG.error("Failed to migrate Property Configuration for {}.", this, e);
}
Expand All @@ -2092,11 +2091,14 @@ public void migrateConfiguration(final ControllerServiceFactory serviceFactory)
}
}

private void migrateProperties(final ControllerServiceFactory serviceFactory) {
private void migrateProperties(final Map<String, String> originalPropertyValues, final ControllerServiceFactory serviceFactory) {
final Processor processor = getProcessor();

final StandardPropertyConfiguration propertyConfig = new StandardPropertyConfiguration(toPropertyNameMap(getEffectivePropertyValues()),
toPropertyNameMap(getRawPropertyValues()), this::mapRawValueToEffectiveValue, toString(), serviceFactory);
final Map<String, String> effectiveValues = new HashMap<>();
originalPropertyValues.forEach((key, value) -> effectiveValues.put(key, mapRawValueToEffectiveValue(value)));

final StandardPropertyConfiguration propertyConfig = new StandardPropertyConfiguration(effectiveValues,
originalPropertyValues, this::mapRawValueToEffectiveValue, toString(), serviceFactory);
try (final NarCloseable nc = NarCloseable.withComponentNarLoader(getExtensionManager(), processor.getClass(), getIdentifier())) {
processor.migrateProperties(propertyConfig);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -428,11 +430,14 @@ public Optional<ProcessGroup> getParentProcessGroup() {
}

@Override
public void migrateConfiguration(final ControllerServiceFactory serviceFactory) {
public void migrateConfiguration(final Map<String, String> originalPropertyValues, final ControllerServiceFactory serviceFactory) {
final ReportingTask task = getReportingTask();

final StandardPropertyConfiguration propertyConfig = new StandardPropertyConfiguration(toPropertyNameMap(getEffectivePropertyValues()),
toPropertyNameMap(getRawPropertyValues()), this::mapRawValueToEffectiveValue, toString(), serviceFactory);
final Map<String, String> effectiveValues = new HashMap<>();
originalPropertyValues.forEach((key, value) -> effectiveValues.put(key, mapRawValueToEffectiveValue(value)));

final StandardPropertyConfiguration propertyConfig = new StandardPropertyConfiguration(effectiveValues,
originalPropertyValues, this::mapRawValueToEffectiveValue, toString(), serviceFactory);

try (final NarCloseable nc = NarCloseable.withComponentNarLoader(getExtensionManager(), task.getClass(), getIdentifier())) {
task.migrateProperties(propertyConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -836,9 +837,12 @@ public void notifyPrimaryNodeChanged(final PrimaryNodeState nodeState) {
}

@Override
public void migrateConfiguration(final ControllerServiceFactory serviceFactory) {
final StandardPropertyConfiguration propertyConfig = new StandardPropertyConfiguration(toPropertyNameMap(getEffectivePropertyValues()),
toPropertyNameMap(getRawPropertyValues()), super::mapRawValueToEffectiveValue, toString(), serviceFactory);
public void migrateConfiguration(final Map<String, String> originalPropertyValues, final ControllerServiceFactory serviceFactory) {
final Map<String, String> effectiveValues = new HashMap<>();
originalPropertyValues.forEach((key, value) -> effectiveValues.put(key, mapRawValueToEffectiveValue(value)));

final StandardPropertyConfiguration propertyConfig = new StandardPropertyConfiguration(effectiveValues,
originalPropertyValues, super::mapRawValueToEffectiveValue, toString(), serviceFactory);

final ControllerService implementation = getControllerServiceImplementation();
try (final NarCloseable nc = NarCloseable.withComponentNarLoader(getExtensionManager(), implementation.getClass(), getIdentifier())) {
Expand Down
Loading