amazon-ecs-render-task-definition icon indicating copy to clipboard operation
amazon-ecs-render-task-definition copied to clipboard

feat: check command input is valid array

Open SimplyFaisal opened this issue 1 year ago • 5 comments

Issue #, if available:

Description of changes: Commands that include spaces within arguments, special characters, or need quoting can break if naively split on whitespace(command.split(' ')) .

Take for example this input: alembic revision --autogenerate -m "Your message here".

Splitting on whitespace will result in container def receving the command [ "alembic", "revision", "--autogenerate", " -m", "Your", "message", " here"] which is incorrect and will result in an error when the command is run.

This PR solves this by validating that the command input is a valid array and adding it to the container definition. Otherwise an error is thrown.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

SimplyFaisal avatar Mar 31 '24 01:03 SimplyFaisal

@iamhopaul123 can you review this please? Thanks!

SimplyFaisal avatar Apr 01 '24 23:04 SimplyFaisal

Hi @SimplyFaisal, thank you so much for your contribution. Apologies on the delay. We will be working on reviewing Pull Requests on the repositories. In the mean time please ensure that below steps, if not already done, are taken care of in your PR:

  1. Verify if PR follows semantic pull request conventions.

  2. Please run npm run package command to update dist/ folder with latest dependencies.

  3. Resolve merge conflicts on the PR

amazreech avatar May 10 '24 19:05 amazreech

Thanks for the info @amazreech. Confirming that the above requests are satisfied.

SimplyFaisal avatar May 12 '24 03:05 SimplyFaisal

Hi @SimplyFaisal, I have added few comments to clarify my understand of the solution provided here. Please do respond with your thoughts.

Also, the unit tests seem to be failing for this, would you also be able to take a look at that.

amazreech avatar Jun 07 '24 19:06 amazreech

@SimplyFaisal @amazreech any progress on this PR? this bug makes our service crash

hfalk avatar Sep 19 '25 12:09 hfalk