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

fix: support docker create arguments from container.options (#1022) #1351

Merged
merged 7 commits into from
Oct 6, 2022

Conversation

alex-savchuk
Copy link
Contributor

@alex-savchuk alex-savchuk commented Sep 16, 2022

Important note: parsing of CLI options of docker is fetched from docker/cli sources explicitly - see docker_cli.go.
Please confirm it's acceptable.

Fixes #711
Fixes #1022

@alex-savchuk alex-savchuk requested a review from a team as a code owner September 16, 2022 06:34
@mergify
Copy link
Contributor

mergify bot commented Sep 16, 2022

@alex-savchuk this pull request has failed checks 🛠

@mergify mergify bot added the needs-work Extra attention is needed label Sep 16, 2022
@codecov
Copy link

codecov bot commented Sep 16, 2022

Codecov Report

Merging #1351 (0ea145d) into master (4f8da0a) will increase coverage by 6.58%.
The diff coverage is 75.38%.

@@            Coverage Diff             @@
##           master    #1351      +/-   ##
==========================================
+ Coverage   57.50%   64.09%   +6.58%     
==========================================
  Files          32       41       +9     
  Lines        4594     6380    +1786     
==========================================
+ Hits         2642     4089    +1447     
- Misses       1729     1996     +267     
- Partials      223      295      +72     
Impacted Files Coverage Δ
pkg/model/action.go 0.00% <0.00%> (ø)
pkg/model/step_result.go 0.00% <ø> (ø)
pkg/container/docker_run.go 13.06% <12.32%> (+7.52%) ⬆️
pkg/model/planner.go 48.82% <25.00%> (-1.60%) ⬇️
pkg/model/workflow.go 50.97% <32.14%> (+0.05%) ⬆️
pkg/container/docker_pull.go 33.33% <33.33%> (ø)
pkg/container/file_collector.go 45.87% <45.87%> (ø)
pkg/common/git/git.go 50.00% <47.91%> (ø)
pkg/container/docker_auth.go 47.61% <50.00%> (+2.61%) ⬆️
pkg/exprparser/interpreter.go 73.37% <53.48%> (-0.02%) ⬇️
... and 31 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mergify
Copy link
Contributor

mergify bot commented Sep 16, 2022

@alex-savchuk this pull request has failed checks 🛠

@alex-savchuk alex-savchuk force-pushed the support-docker-create-args branch from 93f87ce to 1d0c067 Compare September 16, 2022 19:20
@mergify
Copy link
Contributor

mergify bot commented Sep 16, 2022

@alex-savchuk this pull request has failed checks 🛠

Copy link
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with copying this file from docker cli, if this allows act to have amost full docker options support. The opinion of the other maintainer matters, I can't merge anything without their consent.

pkg/container/docker_cli.go Show resolved Hide resolved
@mergify
Copy link
Contributor

mergify bot commented Sep 17, 2022

@alex-savchuk this pull request has failed checks 🛠

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented Sep 17, 2022

@alex-savchuk this pull request has failed checks 🛠

@alex-savchuk alex-savchuk force-pushed the support-docker-create-args branch from 16583b0 to baf949b Compare September 17, 2022 17:14
@mergify
Copy link
Contributor

mergify bot commented Sep 17, 2022

@alex-savchuk this pull request has failed checks 🛠

@alex-savchuk alex-savchuk force-pushed the support-docker-create-args branch from baf949b to 73242e6 Compare September 17, 2022 17:44
@mergify
Copy link
Contributor

mergify bot commented Sep 17, 2022

@alex-savchuk this pull request has failed checks 🛠

@alex-savchuk alex-savchuk force-pushed the support-docker-create-args branch from 73242e6 to 9781bfb Compare September 17, 2022 18:35
@mergify
Copy link
Contributor

mergify bot commented Sep 17, 2022

@alex-savchuk this pull request has failed checks 🛠

@alex-savchuk
Copy link
Contributor Author

alex-savchuk commented Sep 18, 2022

It's a bit not clear for me what to do with codecov/project check.

I look at diff report at https://codecov.io/gh/nektos/act/compare/4f8da0a51cd44753f3e4ea0364877f6d2aa11f1d...9781bfbe18671a3529340150d12c3eb6c5e20c67/changes
but don't understand how my small changes result into this decreasing.

Maybe we need to switch HEAD of coverage report to some modern version ?
Or I need to add tests for logger.go/run_context.go in PR?

Upd: solved by adding tests of opts.go

@mergify
Copy link
Contributor

mergify bot commented Sep 19, 2022

@alex-savchuk this pull request is now in conflict 😩

@mergify mergify bot added the conflict PR has conflicts label Sep 19, 2022
@alex-savchuk alex-savchuk force-pushed the support-docker-create-args branch from 9781bfb to 1a9b3c9 Compare September 19, 2022 08:57
@mergify mergify bot removed the conflict PR has conflicts label Sep 19, 2022
@mergify
Copy link
Contributor

mergify bot commented Sep 19, 2022

@alex-savchuk this pull request has failed checks 🛠

Copy link
Member

@KnisterPeter KnisterPeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the license, this looks fine to me. Great addition.

pkg/container/docker_cli.go Outdated Show resolved Hide resolved
@mergify
Copy link
Contributor

mergify bot commented Sep 20, 2022

@alex-savchuk this pull request has failed checks 🛠

@alex-savchuk alex-savchuk force-pushed the support-docker-create-args branch from f931a27 to ee89687 Compare September 20, 2022 22:54
@mergify
Copy link
Contributor

mergify bot commented Sep 20, 2022

@alex-savchuk this pull request has failed checks 🛠

KnisterPeter
KnisterPeter previously approved these changes Sep 21, 2022
@ChristopherHX
Copy link
Contributor

but don't understand how my small changes result into this decreasing.

Your change isn't that small 1000 new lines of text without tests from the docker cli. I think you can fix the high coverage decrease by adding the test file of the added docker cli file https://github.com/docker/cli/blob/9ac8584acfd501c3f4da0e845e3a40ed15c85041/cli/command/container/opts_test.go.

I'm not approving yet, because I know that only the owner can merge a PR with a failed status check and I haven't tested it yet.

@mergify
Copy link
Contributor

mergify bot commented Sep 26, 2022

@alex-savchuk this pull request is now in conflict 😩

@alex-savchuk
Copy link
Contributor Author

After merge #711, #1022 are expected to be fixed.
Also passing of docker options may help to resolve #676, #569, #1091

@mergify
Copy link
Contributor

mergify bot commented Oct 3, 2022

@alex-savchuk this pull request is now in conflict 😩

@mergify mergify bot added the conflict PR has conflicts label Oct 3, 2022
@alex-savchuk alex-savchuk force-pushed the support-docker-create-args branch from b5fe3b3 to 097f894 Compare October 4, 2022 13:14
@mergify mergify bot removed the conflict PR has conflicts label Oct 4, 2022
@alex-savchuk
Copy link
Contributor Author

@act-maintainers Now we have coverage, tests etc. Could you please take a look and approve/merge if everything is ok? :)

ChristopherHX
ChristopherHX previously approved these changes Oct 4, 2022
Copy link
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, this probably works better than the original actions/runner.
For the record, I tested with this workflow

on: push
jobs:
  _:
    container:
      image: ubuntu:latest
      options: --privileged --network=bridge
    steps:
      - run: echo "Hello World"

And inpected the docker container via docker inspect to see if the flags were applied.
Big PR's like this one seem to have very long review times to get 3 approvals

@mergify
Copy link
Contributor

mergify bot commented Oct 4, 2022

@alex-savchuk this pull request is now in conflict 😩

@mergify mergify bot added the conflict PR has conflicts label Oct 4, 2022
KnisterPeter
KnisterPeter previously approved these changes Oct 5, 2022
Copy link
Member

@KnisterPeter KnisterPeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like it

@alex-savchuk alex-savchuk force-pushed the support-docker-create-args branch from 097f894 to c7870dd Compare October 5, 2022 06:31
@mergify mergify bot removed the conflict PR has conflicts label Oct 5, 2022
Copy link
Contributor

@cplee cplee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay - this was a large PR and took awhile to get through all the changes. Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue: parse all container/services options container options not respected
4 participants