Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to scaffold devcontainer #320

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tanwigeetika1618
Copy link
Contributor

@tanwigeetika1618 tanwigeetika1618 commented Nov 11, 2024

JIRA ticket: https://issues.redhat.com/browse/AAP-32979

Description

  • Implemented Scaffolding for devcontainer Resource Type:
    • Updated add.py to include template data handling for the devcontainer resource type.
    • Modified arg_parser.py to support the devcontainer resource type alongside existing types like devfile and role.

Changes

  • add.py:

    • Added logic to handle devcontainer resource type scaffolding.
    • Integrated template_data for both devfile and devcontainer to ensure proper templating during the scaffolding process.
    • Enhanced the _scaffold method to include conditions for devcontainer.
  • arg_parser.py:

    • Updated argument parsing to include devcontainer as a valid resource-type.
    • Ensured that optional arguments are appropriately handled for the new resource type.
  • Testing and Validation:

    1. Successful Scaffolding: Update unit tests to cover scenarios involving the scaffolding process for devcontainer to ensure that all necessary files and directories are correctly copied to the destination path.
    2. Overwrite Scenario: Modifies the .devcontainer content and checks the behavior of the overwrite parameter, ensuring that conflicts are handled appropriately during scaffolding.

Summary:
This update provides the initial scaffolding capability for devcontainer resources to the destination path provided.

@tanwigeetika1618 tanwigeetika1618 added the enhancement New feature or request label Nov 11, 2024
@tanwigeetika1618 tanwigeetika1618 self-assigned this Nov 11, 2024
@tanwigeetika1618 tanwigeetika1618 marked this pull request as ready for review November 12, 2024 04:30
@tanwigeetika1618 tanwigeetika1618 requested a review from a team as a code owner November 12, 2024 04:30
@audgirka
Copy link
Contributor

@cidrblock When scaffolded this uses the community-ansible-devtools image.
What would happen in the downstream environment scenario when the devcontainer file is scaffolded?
Will it use a downstream image or do we need to provide the image name as part of TemplateData instance creation?

@audgirka
Copy link
Contributor

@ssbarnea any thoughts on this?

@audgirka
Copy link
Contributor

audgirka commented Nov 13, 2024

@tanwigeetika1618 Per discussion with @cidrblock, for now we can add a downstream image option which will be commented by default while scaffolding the devcontainer files.
Will need a jira and more discussion on adding another cli option.
@ssbarnea ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants