[Frontend] Use array for `include` in Pipeline Execution Policies

Why are we doing this work

Although CI schema allows both object and array for include, the CI YAML documentation only mentions array.

We should adjust the frontend to parse & save include as array with 1 item.

Backend schema is adjusted in !155702 (merged) to account for that.

The following discussion from !155702 (merged) should be addressed:

  • @furkanayhan started a discussion: (+14 comments)

    So, we'll not allow anything else, like writing custom content for a PEP, right? Only inclusion from other project's file. Have we decided on it somewhere? 🤔

Relevant links

Non-functional requirements

  • Documentation:
  • Feature flag:
  • Performance:
  • Testing:

Implementation plan

A rough patch:

diff --git a/ee/app/assets/javascripts/security_orchestration/components/policy_editor/pipeline_execution/action/action_section.vue b/ee/app/assets/javascripts/security_orchestration/components/policy_editor/pipeline_execution/action/action_section.vue
index 2f320c88dad1..65a8017fbeee 100644
--- a/ee/app/assets/javascripts/security_orchestration/components/policy_editor/pipeline_execution/action/action_section.vue
+++ b/ee/app/assets/javascripts/security_orchestration/components/policy_editor/pipeline_execution/action/action_section.vue
@@ -21,7 +21,9 @@ export default {
     },
   },
   data() {
-    const { project: selectedProject } = parseCustomFileConfiguration(this.action.include);
+    const { project: selectedProject } = parseCustomFileConfiguration(
+      this.action.include && this.action.include[0],
+    );

     return {
       doesFileExist: true,
@@ -30,7 +32,7 @@ export default {
   },
   computed: {
     ciConfigurationPath() {
-      return this.action.include || {};
+      return (this.action.include && this.action.include[0]) || {};
     },
     filePath() {
       return this.ciConfigurationPath.file;
@@ -118,7 +120,7 @@ export default {
       }
     },
     setCiConfigurationPath(pathConfig) {
-      this.$emit('changed', 'content', { include: pathConfig });
+      this.$emit('changed', 'content', { include: [pathConfig] });
     },
   },
 };

Verification steps