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

feat: Add desired tasks #505

Merged
merged 8 commits into from
Feb 7, 2024
Merged

feat: Add desired tasks #505

merged 8 commits into from
Feb 7, 2024

Conversation

romankydybets
Copy link
Contributor

I would like to ask for help in the PR, as I can't fix 1 test which is failing.

Issue #499

Add support for DesiredCount
it would be great to have DesiredCount support during deployment.
https://docs.aws.amazon.com/cli/latest/reference/ecs/update-service.html
--desired-count

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

@romankydybets romankydybets marked this pull request as draft July 21, 2023 21:23
@romankydybets
Copy link
Contributor Author

@clareliguori could i ask for help to solve issue with test?

@KollaAdithya
Copy link
Contributor

KollaAdithya commented Aug 1, 2023

Hello @romankydybets !

Thanks for the PR! Is there some error you are getting when running the tests? can you paste the error over here?

@romankydybets
Copy link
Contributor Author

@KollaAdithya
this is what i have, honestly i try to debug on my own, but unfortunately can't achieve this

  ● Deploy to ECS › does not wait for a CodeDeploy deployment, parses JSON appspec file

    expect(jest.fn()).toHaveBeenCalledTimes(expected)

    Expected number of calls: 0
    Received number of calls: 1

      767 |
      768 |         await run();
    > 769 |         expect(core.setFailed).toHaveBeenCalledTimes(0);
          |                                ^
      770 |
      771 |         expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
      772 |         expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');

      at Object.toHaveBeenCalledTimes (index.test.js:769:32)

@KollaAdithya
Copy link
Contributor

KollaAdithya commented Aug 2, 2023

Hi @romankydybets !
In order to fix the unit test cases you can just modify the test case with below ⬇️ . I already ran testcases with the modification locally, all the testcases are getting passed.

test('does not wait for a CodeDeploy deployment, parses JSON appspec file', async () => {
        core.getInput = jest
            .fn()
            .mockReturnValueOnce('task-definition.json') // task-definition
            .mockReturnValueOnce('service-456')          // service
            .mockReturnValueOnce('cluster-789')          // cluster
            .mockReturnValueOnce('false')                // wait-for-service-stability
            .mockReturnValueOnce('')                     // wait-for-minutes
            .mockReturnValueOnce('')                     // force-new-deployment
            .mockReturnValueOnce('')                     // desired count
            .mockReturnValueOnce('/hello/appspec.json')  // codedeploy-appspec
            .mockReturnValueOnce('MyApplication')        // codedeploy-application
            .mockReturnValueOnce('MyDeploymentGroup');    // codedeploy-deployment-group

@romankydybets
Copy link
Contributor Author

thank you @KollaAdithya, did a fix, please take a look.

@romankydybets romankydybets marked this pull request as ready for review August 3, 2023 20:08
@romankydybets
Copy link
Contributor Author

Is there any updates on this?

@marns93
Copy link

marns93 commented Dec 11, 2023

Any updates?

@romankydybets
Copy link
Contributor Author

@clareliguori could you please review?

KollaAdithya
KollaAdithya previously approved these changes Feb 6, 2024
@KollaAdithya KollaAdithya added the work-in-progress mark a PR as WIP to prevent merging label Feb 6, 2024
@KollaAdithya KollaAdithya changed the title Add desired tasks feat: Add desired tasks Feb 6, 2024
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@KollaAdithya KollaAdithya removed the work-in-progress mark a PR as WIP to prevent merging label Feb 7, 2024
@mergify mergify bot merged commit e5f78d3 into aws-actions:master Feb 7, 2024
8 checks passed
chiragrajk pushed a commit to chiragrajk/amazon-ecs-deploy-task-definition that referenced this pull request Feb 19, 2024
* add desired count

* add desired count

* add desired count

* fix test for desired count

* small change

* update dist/index.js

* address feedback @iamhopaul123

* update dist/index.js

---------

Co-authored-by: Adithya Kolla <kolladit@amazon.com>
@marns93
Copy link

marns93 commented Feb 19, 2024

@KollaAdithya @iamhopaul123 Is it possible to publish a new release?

@romankydybets romankydybets deleted the add_desired_tasks branch February 20, 2024 02:42
@mendhak
Copy link

mendhak commented Mar 21, 2024

Please could this be released, it's very useful!

chiragrajk pushed a commit to chiragrajk/amazon-ecs-deploy-task-definition that referenced this pull request Apr 9, 2024
* add desired count

* add desired count

* add desired count

* fix test for desired count

* small change

* update dist/index.js

* address feedback @iamhopaul123

* update dist/index.js

---------

Co-authored-by: Adithya Kolla <kolladit@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants