autosarzs / Dev

Development AUTOSAR
Mozilla Public License 2.0
50 stars 21 forks source link

[Feature Request]: Implement Automatic DevContainer Update Workflow #100

Open autosarzs opened 1 month ago

autosarzs commented 1 month ago

Contact Details

mustafa.bahaa

Description

Description

For pull requests that modify the files Dockerfile or .devcontainer, we need to implement automatic triggering of the devcontainer_update workflow. This workflow ensures that the latest DevContainer is always updated for use by all other workflows, ensuring that subsequent builds incorporate the merged changes from the pull request.

Details:

  1. Automatic Workflow Triggering: Whenever a pull request modifies the Dockerfile or .devcontainer files, the devcontainer_update workflow should be automatically invoked. This guarantees that subsequent builds utilize the latest changes from the merged pull request.

  2. Scheduled Workflow Modification: The existing scheduled workflow triggers on each push to the main branch. However, it currently fails if triggered immediately after a pull request merge because it doesn't wait for the devcontainer_update workflow to complete. To address this, we need to modify the scheduled workflow to:

    • Wait for Completion: Ensure that the scheduled workflow does not start if the devcontainer_update workflow is running.
    • Trigger After Completion: Once the devcontainer_update workflow finishes executing, the scheduled workflow should automatically start to incorporate the updated DevContainer image.

Implementation Steps:

  1. Implement logic to detect changes in the Dockerfile or .devcontainer files in pull requests.
  2. Configure the triggering mechanism to automatically invoke the devcontainer_update workflow upon detection of such changes.
  3. Modify the scheduled workflow to include checks for the devcontainer_update workflow's status before execution.
  4. Define the workflow dependencies to ensure the scheduled workflow waits for the devcontainer_update workflow to complete before starting.