Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EBA502009DC for ; Tue, 2 May 2017 19:34:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EA6A0160BBF; Tue, 2 May 2017 17:34:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 455BB160BAB for ; Tue, 2 May 2017 19:34:09 +0200 (CEST) Received: (qmail 48006 invoked by uid 500); 2 May 2017 17:34:08 -0000 Mailing-List: contact commits-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list commits@nifi.apache.org Received: (qmail 47995 invoked by uid 99); 2 May 2017 17:34:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 May 2017 17:34:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 74E37C88EC for ; Tue, 2 May 2017 17:34:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.001 X-Spam-Level: X-Spam-Status: No, score=-100.001 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id h0VNvlY-SyaU for ; Tue, 2 May 2017 17:34:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id A47935F5F9 for ; Tue, 2 May 2017 17:34:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E5C4EE0D50 for ; Tue, 2 May 2017 17:34:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5732821DEC for ; Tue, 2 May 2017 17:34:04 +0000 (UTC) Date: Tue, 2 May 2017 17:34:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@nifi.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MINIFI-275) Configuration without IDs for components causes exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 02 May 2017 17:34:10 -0000 [ https://issues.apache.org/jira/browse/MINIFI-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15993357#comment-15993357 ] ASF GitHub Bot commented on MINIFI-275: --------------------------------------- Github user phrocker commented on a diff in the pull request: https://github.com/apache/nifi-minifi-cpp/pull/85#discussion_r114377308 --- Diff: libminifi/src/core/yaml/YamlConfiguration.cpp --- @@ -491,14 +510,18 @@ void YamlConfiguration::parsePortYaml(YAML::Node *portNode, YAML::Node inputPortsObj = portNode->as(); - // generate the random UIID - uuid_generate(uuid); - - auto portId = inputPortsObj["id"].as(); + // Check for required fields + checkRequiredField(&inputPortsObj, "name"); auto nameStr = inputPortsObj["name"].as(); + checkRequiredField(&inputPortsObj, "id", "The field 'id' is required for " + "the port named '" + nameStr + "' in the YAML Config. If this port " + "is specificy an input port for a NiFi Remote Process Group, the port " + "id should match the id of of the input port in the NiFi configuration. " + "This is a UUID of the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX."); + auto portId = inputPortsObj["id"].as(); uuid_parse(portId.c_str(), uuid); - port = new minifi::RemoteProcessorGroupPort(nameStr.c_str(), uuid); + port = new minifi::RemoteProcessorGroupPort(nameStr, uuid); processor = (std::shared_ptr) port; --- End diff -- No that cast is not okay. That should be ``` port = std::make_shared(nameStr,uuid); processor = std::static_pointer_cast(port); ``` > Configuration without IDs for components causes exceptions > ---------------------------------------------------------- > > Key: MINIFI-275 > URL: https://issues.apache.org/jira/browse/MINIFI-275 > Project: Apache NiFi MiNiFi > Issue Type: Bug > Components: C++, Processing Configuration > Reporter: Aldrin Piri > Assignee: Kevin Doran > Priority: Blocker > Fix For: cpp-0.2.0 > > Attachments: config.TEST.yml > > > One of the changes to how components are handled in C++ introduced a defect into the original construct over the version 1 schema of the YAML. > The absence of this ID causes a YAML exception. > We should provide handling to support configurations how they were created originally, possibly providing a default/generated ID where one isn't specified, and start laying the foundation for versioned schemas as provided in our Java implementation. -- This message was sent by Atlassian JIRA (v6.3.15#6346)