Skip to content

Fix method receivers and error handling in sharedaction/resource.go #3513

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wayneeseguin
Copy link
Contributor

  • Add named receivers to 6 methods that had unnamed receivers (Actor)
  • Fix error handling for ignore.CompileIgnoreLines() calls (4 occurrences)
  • Fix ignored error from ZipDirectoryResources in CreateArchive method

Thank you for contributing to the CF CLI! Please read the following:

  • Please make sure you have implemented changes in line with the contributing guidelines
  • We're not allowed to accept any PRs without a signed CLA, no matter how small.
    If your contribution falls under a company CLA but your membership is not public, expect delays while we confirm.
  • All new code requires tests to protect against regressions.
  • Contributions must be made against the appropriate branch. See the contributing guidelines
  • Contributions must conform to our style guide. Please reach out to us if you have questions.

Note: Please create separate PR for every branch (main, v8 and v7) as needed.

Description of the Change

We must be able to understand the design of your change from this description.
Keep in mind that the maintainer reviewing this PR may not be familiar with or
have worked with the code here recently, so please walk us through the concepts.

Why Is This PR Valuable?

What benefits will be realized by the code change? What users would want this change? What user need is this change addressing?

Applicable Issues

List any applicable GitHub Issues here

How Urgent Is The Change?

Is the change urgent? If so, explain why it is time-sensitive.

Other Relevant Parties

Who else is affected by the change?

  - Add named receivers to 6 methods that had unnamed receivers (Actor)
  - Fix error handling for ignore.CompileIgnoreLines() calls (4 occurrences)
  - Fix ignored error from ZipDirectoryResources in CreateArchive method
@norman-abramovitz
Copy link

norman-abramovitz commented May 27, 2025

Does this need to fixed on the V8 branch as well? It is interfering with ginkgo and go test unit test writing.

`go test cf_targets_test.go

code.cloudfoundry.org/cli/actor/sharedaction

../../../go/pkg/mod/code.cloudfoundry.org/[email protected]/actor/sharedaction/resource.go:441:11: not enough return values
have (*ignore.GitIgnore)
want (*ignore.GitIgnore, error)
../../../go/pkg/mod/code.cloudfoundry.org/[email protected]/actor/sharedaction/resource.go:444:9: not enough return values
have (*ignore.GitIgnore)
want (*ignore.GitIgnore, error)
../../../go/pkg/mod/code.cloudfoundry.org/[email protected]/actor/sharedaction/resource.go:469:9: not enough return values
have (*ignore.GitIgnore)
want (*ignore.GitIgnore, error)
FAIL command-line-arguments [build failed]
FAIL`

@norman-abramovitz
Copy link

norman-abramovitz commented May 27, 2025

Here is the ginkgo failure for the same reason.

`ginkgo .
2025/05/27 13:10:01 maxprocs: Leaving GOMAXPROCS=12: CPU quota undefined
Failed to compile cf-targets-plugin:

code.cloudfoundry.org/cli/actor/sharedaction

../../../go/pkg/mod/code.cloudfoundry.org/[email protected]/actor/sharedaction/resource.go:441:11: not enough return values
have (*ignore.GitIgnore)
want (*ignore.GitIgnore, error)
../../../go/pkg/mod/code.cloudfoundry.org/[email protected]/actor/sharedaction/resource.go:444:9: not enough return values
have (*ignore.GitIgnore)
want (*ignore.GitIgnore, error)
../../../go/pkg/mod/code.cloudfoundry.org/[email protected]/actor/sharedaction/resource.go:469:9: not enough return values
have (*ignore.GitIgnore)
want (*ignore.GitIgnore, error)

Ginkgo ran 1 suite in 340.711542ms

Test Suite Failed`

Once I fixed my downloaded code in ~/go/pkg.... I was able to continue writing my unit tests.

@norman-abramovitz
Copy link

Confused why ignore.CompileIgnoreLines is not returning two values. I will have to dig deeper into the CLI code.

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.

2 participants