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

Disable Go Workspaces when executing 'go list' in packaging process #37579

Merged
merged 3 commits into from
Jan 15, 2024

Conversation

AndersonQ
Copy link
Member

running 'go list' with Go worspaces enabled will report all modules listed on go.work, what would make GetModuleName to fail as it requires 'go list' to return only one module, the agent itself.

Proposed commit message

Disable Go Workspaces when executing 'go list' in packaging process

running 'go list' with Go worspaces enabled will report all modules listed on go.work, what would make GetModuleName to fail as it requires 'go list' to return only one module, the agent itself.

What does this PR do?

Disable Go Workspaces when executing 'go list' in agent packaging process

Why is it important?

Running 'go list' with Go worspaces enabled will report all modules listed on go.work, what would make GetModuleName to fail as it requires 'go list' to return only one module, the agent itself.
Therefore if Go workspaces is enabled, packaging the agent will fail

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

How to test this PR locally

  • create a Go workspace
  • add a few modules, e.g. elastic-agent-client, elastic-agent-libs
  • run mage package
  • without this change it'll fail

Related issues

  • N/A

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

running 'go list' with Go worspaces enabled will report all modules listed on go.work, what would make GetModuleName to fail as it requires 'go list' to return only one module, the agent itself.
@AndersonQ AndersonQ added enhancement release-note:skip The PR should be ignored when processing the changelog Team:Elastic-Agent Label for the Agent team backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.12.0 Automated backport with mergify labels Jan 8, 2024
@AndersonQ AndersonQ self-assigned this Jan 8, 2024
@AndersonQ AndersonQ requested a review from a team as a code owner January 8, 2024 16:57
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jan 8, 2024
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2024-01-08T16:57:50.777+0000

  • Duration: 143 min 34 sec

Test stats 🧪

Test Results
Failed 0
Passed 28760
Skipped 2015
Total 30775

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@AndersonQ AndersonQ enabled auto-merge (squash) January 9, 2024 06:04
@AndersonQ AndersonQ requested a review from a team as a code owner January 9, 2024 09:39
@elasticmachine
Copy link
Collaborator

💔 Build Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2024-01-09T09:39:31.251+0000

  • Duration: 165 min 19 sec

Test stats 🧪

Test Results
Failed 0
Passed 28760
Skipped 2015
Total 30775

Steps errors 1

Expand to view the steps failures

Building Beats » Beats Packaging » PR-37579
  • Took 32 min 55 sec . View more details here
  • Description: null

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

💔 Build Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 164 min 4 sec

Pipeline error 1

This error is likely related to the pipeline itself. Click here
and then you will see the error (either incorrect syntax or an invalid configuration).

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

💔 Build Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 163 min 53 sec

Pipeline error 1

This error is likely related to the pipeline itself. Click here
and then you will see the error (either incorrect syntax or an invalid configuration).

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

go.mod Outdated
@@ -419,3 +419,5 @@ replace (

// Exclude this version because the version has an invalid checksum.
exclude github.com/docker/distribution v2.8.0+incompatible

replace github.com/elastic/elastic-agent-client/v7 => github.com/AndersonQ/elastic-agent-client/v7 v7.0.0-20240109062623-907af5c552fb
Copy link
Member

Choose a reason for hiding this comment

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

Did you leave it on purpose? I don't think it's a good idea.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, my bad

Copy link
Contributor

Choose a reason for hiding this comment

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

@AndersonQ it seems you haven't pushed the update for this line.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

go.mod Outdated
@@ -419,3 +419,5 @@ replace (

// Exclude this version because the version has an invalid checksum.
exclude github.com/docker/distribution v2.8.0+incompatible

replace github.com/elastic/elastic-agent-client/v7 => github.com/AndersonQ/elastic-agent-client/v7 v7.0.0-20240109062623-907af5c552fb
Copy link
Contributor

Choose a reason for hiding this comment

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

@AndersonQ it seems you haven't pushed the update for this line.

@AndersonQ AndersonQ force-pushed the disable-go-workspaces-on-package branch from 90028e5 to 725d3a7 Compare January 15, 2024 09:12
@AndersonQ AndersonQ requested review from belimawr and rdner January 15, 2024 09:34
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 133 min 38 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@AndersonQ AndersonQ merged commit d4f5d9f into elastic:main Jan 15, 2024
86 of 89 checks passed
mergify bot pushed a commit that referenced this pull request Jan 15, 2024
…37579)

running 'go list' with Go worspaces enabled will report all modules listed on go.work, what would make GetModuleName to fail as it requires 'go list' to return only one module, the agent itself.

(cherry picked from commit d4f5d9f)
mergify bot pushed a commit that referenced this pull request Jan 15, 2024
…37579)

running 'go list' with Go worspaces enabled will report all modules listed on go.work, what would make GetModuleName to fail as it requires 'go list' to return only one module, the agent itself.

(cherry picked from commit d4f5d9f)
AndersonQ added a commit that referenced this pull request Jan 15, 2024
…37579) (#37635)

running 'go list' with Go worspaces enabled will report all modules listed on go.work, what would make GetModuleName to fail as it requires 'go list' to return only one module, the agent itself.

(cherry picked from commit d4f5d9f)

Co-authored-by: Anderson Queiroz <[email protected]>
AndersonQ added a commit that referenced this pull request Jan 15, 2024
…37579) (#37634)

running 'go list' with Go worspaces enabled will report all modules listed on go.work, what would make GetModuleName to fail as it requires 'go list' to return only one module, the agent itself.

(cherry picked from commit d4f5d9f)

Co-authored-by: Anderson Queiroz <[email protected]>
Scholar-Li pushed a commit to Scholar-Li/beats that referenced this pull request Feb 5, 2024
…lastic#37579)

running 'go list' with Go worspaces enabled will report all modules listed on go.work, what would make GetModuleName to fail as it requires 'go list' to return only one module, the agent itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.12.0 Automated backport with mergify enhancement release-note:skip The PR should be ignored when processing the changelog Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants