XComp commented on code in PR #23971:
URL: https://github.com/apache/flink/pull/23971#discussion_r1449060542


##########
.github/actions/select_workflow_configs/action.yml:
##########
@@ -0,0 +1,59 @@
+# 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: "Selects Flink workflow configurations"
+description: "Loads the relevant workflow configuration from a given folder."
+inputs:
+  config-folder:
+    description: "The directory in which the workflow configurations are 
located."
+    required: true
+  profile:
+    description: >-
+      The profile that's used to access the desired workflow configuration 
+      file. Any invalid profile (i.e. no file exists) will lead to using 
+      the default workflow configurations. Configuration files are expected 
+      to have the name format 'flink-workflow.<profile>.json' and should be 
+      located in the folder that's specified through the 'config-folder' 
parameter.
+    required: true
+outputs:
+  workflow-configurations:
+    description: "A JSON representation of the workflow configurations."
+    value: "${{ steps.workflow-selection.outputs.configs }}"
+runs:
+  using: "composite"
+  steps:
+    - name: "Loads Flink workflow configurations"
+      id: workflow-selection
+      shell: bash
+      run: |
+        fallback_profile="default"
+        fallback_path="${{ inputs.config-folder 
}}/flink-workflow.${fallback_profile}.json"

Review Comment:
   > Why can't we use the configuration from the respective branch? checkout 
branch, use nightly config.
   
   Scheduled workflow runs will be triggered from `master`. The workflow 
configuration (the json file) is therefore also loaded from `master`. The 
workflow then triggers the checkout of individual branches.
   
   > Do we plan to have different workflow configs for a single branch?
   
   We have that right now: 1.18 doesn't include Java 21. But you're right: It's 
not a common case, I'd say.
   
   There are some reasons why I came up with this solution (having dedicated 
per-branch configuration files and one workflow file per branch):
   
   Initially, I went for a single workflow yaml that would trigger a fixed list 
of release branches through the matrix strategy.  We could have disabled the 
Java 21 workflow. But the flaw of this approach is that the workflow will be 
nested in three levels:
   1. branch
   2. profiles
   3. the individual jobs of flink-ci.template.yml
   
   GitHub Actions doesn't work well with three levels. The dropdown per profile 
would go away. Instead, we would have a dropdown per branch with all profiles 
and their individual jobs flattened out in a long list. Unfortunately, I don't 
have a workflow run saved anymore which would show what I mean. But It's 
essentially similar what we have with Azure Pipelines: A long list of 
individual jobs that are hard to parse by the human eye. 
   
   Having individual workflow yamls for each branch helped work around this 
issue with the cost of having kind of redundant code. I introduced the workflow 
configuration JSON files to reduce the redundancy if the workflow configuration 
to a minimum.



-- 
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]

Reply via email to