Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-8603

Post start events execute in alphabetic order rather than listed sequence, leading to potential confusion in Openshift Dev Spaces

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • Release Notes
    • Hide
      = Post start events execute in alphabetic order rather than listed sequence, leading to potential confusion

      Previously, `postStart` commands were executed based on alphabetical order rather than the sequence in which they were listed in the devfile, leading to potential confusion, especially when a specific execution order is expected based on the listed sequence. Starting from this release, the execution happens in sequential order in the way the commands are listed in the `postStart` section of a devfile:

      [source,code]
      ----
      postStart:
        - command-one
        - command-two
        - command-three
      ----
      Show
      = Post start events execute in alphabetic order rather than listed sequence, leading to potential confusion Previously, `postStart` commands were executed based on alphabetical order rather than the sequence in which they were listed in the devfile, leading to potential confusion, especially when a specific execution order is expected based on the listed sequence. Starting from this release, the execution happens in sequential order in the way the commands are listed in the `postStart` section of a devfile: [source,code] ---- postStart:   - command-one   - command-two   - command-three ----
    • Bug Fix
    • Done

      Description of problem:

      Currently, post-start events are executed based on alphabetic order rather than the sequence in which they are listed in the devfile leading to potential confusion,  especially when specific execution order is expected based on the listed sequence.

      Support for preserving the listed order of execution would improve user experience and prevent unintended outcomes.

      Prerequisites (if any, like setup, operators/versions):

      Openshift Dev Spaces (any version)

      Steps to Reproduce

      Define multiple post-start events in a devfile and start a workspace

       

      commands:
      - id: event-one
        exec:
          commandLine: >-
            sleep 5 &&
            date > event-one-date.txt &&
            sleep 5
          component: tools
          label: ""
          workingDir: "${HOME}"
      - id: event-two
        exec:
          commandLine: >-
            sleep 5 &&
            date > event-two-date.txt &&
            sleep 5
          component: tools
          label: ""
          workingDir: "${HOME}"
      - id: event-three
        exec:
          commandLine: >-
            sleep 5 &&
            date > event-three-date.txt &&
            sleep 5
          component: tools
          label: ""
          workingDir: "${HOME}"
      events:
      postStart:
        - event-one
        - event-two
        - event-three

       

      Open the terminal of workspace and list the files

      Actual results:

      The Date shows that the execution happens in alphabetical order:

       

      che (main) $ ls -alrt  /home/user/*date.txt
      \-rw-r--r--. 1 user root 29 Apr 12 13:47 /home/user/event-one-date.txt
      \-rw-r--r--. 1 user root 29 Apr 12 13:48 /home/user/event-three-date.txt
      \-rw-r--r--. 1 user root 29 Apr 12 13:48 /home/user/event-two-date.txt
      che (main) $ for i in /home/user/*date.txt; do echo $i;cat $i;done
      /home/user/event-one-date.txt
      Sat Apr 12 13:47:57 UTC 2025
      /home/user/event-three-date.txt
      Sat Apr 12 13:48:07 UTC 2025
      /home/user/event-two-date.txt
      Sat Apr 12 13:48:17 UTC 2025 

       

       

      Expected results:

      The execution should happen in sequential order in the way its listed in postStart command:

       

      che (main) $ ls -alrt  /home/user/*date.txt
      \-rw-r--r--. 1 user root 29 Apr 12 13:47 /home/user/event-one-date.txt
      \-rw-r--r--. 1 user root 29 Apr 12 13:48 /home/user/event-two-date.txt
      \-rw-r--r--. 1 user root 29 Apr 12 13:48 /home/user/event-three-date.txt
      che (main) $ for i in /home/user/*date.txt; do echo $i;cat $i;done
      /home/user/event-one-date.txt
      Sat Apr 12 13:47:57 UTC 2025
      /home/user/event-two-date.txt
      Sat Apr 12 13:48:07 UTC 2025
      /home/user/event-three-date.txt
      Sat Apr 12 13:48:17 UTC 2025

       

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Acceptance criteria: 

       

      Definition of Done:

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

       

              rokumar Rohan Kumar
              rhn-support-gio Ginilekshmi A O (Inactive)
              Jana Vrbkova Jana Vrbkova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: