bbende commented on code in PR #8726: URL: https://github.com/apache/nifi/pull/8726#discussion_r1587884737
########## nifi-api/src/main/java/org/apache/nifi/registry/flow/BucketLocation.java: ########## @@ -0,0 +1,54 @@ +/* + * + * * 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. + * + */ + +package org.apache.nifi.registry.flow; + +/** + * Information for locating a bucket in a flow registry. + */ +public class BucketLocation { + + private String branch; Review Comment: Great question... The way it is currently designed, branch is the first argument that needs to be chosen in order to then determine the buckets. For example, in Git/GitHub, a Bucket is just a top-level directory in the repo. So in order to know what top-level directories exist, you need to list the contents of the repo on a given branch. Also, in the current design, once a process group is under version control, either by `Import From Registry` or `Start Version Control`, at that point the branch of the PG can't change, just like you can't change Bucket. So you can't have a PG tracking to `Branch1 - Bucket1` and then all of a sudden change it to `Branch2` where you are worried about maybe `Bucket1` doesn't exist. The GitHub workflow I have been testing is something like the following... - Lets assume the Git repo has the branch `main` and already has a flow named `My Flow` in `My Bucket` - `Production` NiFi has a process group that imported this flow from `main` - Some user wants to make a change to this flow... - They go to GitHub, or command line Git, and they create a new branch from `main` called `flow-change-1` (or whatever) - At this point the branch `flow-change-1` has the same buckets and flows as `main` - They go the `Development` NiFi, or their laptop, and they `Import Flow From Registry` and choose the `flow-change-1` - `My Bucket` - `My Flow` - latest version - They make changes and commit the next version which commits to `flow-change-1` branch - They go to GitHub UI and raise a PR from `flow-change-1` to `main` - Someone else reviews the PR and merges to `main` - Someone else goes to `Production` NiFi and now sees a new version available for the PG tracking to `main` - They do Change Flow Version to the new version - At this point maybe the PG in the `Dev` NiFi is deleted because it was a temporary feature branch, or maybe this process it iterated for more changes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
