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 agent packaging process #4039

Merged
merged 4 commits into from
Jan 22, 2024

Conversation

AndersonQ
Copy link
Member

@AndersonQ AndersonQ commented Jan 8, 2024

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?
  • ...

@AndersonQ AndersonQ added enhancement New feature or request skip-changelog 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:47
@AndersonQ AndersonQ force-pushed the disable-go-workspaces-on-package branch 2 times, most recently from ea1082d to da84124 Compare January 8, 2024 16:48
@AndersonQ AndersonQ enabled auto-merge (squash) January 8, 2024 16:48
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 force-pushed the disable-go-workspaces-on-package branch from da84124 to 8f49998 Compare January 8, 2024 16:50
@pierrehilbert pierrehilbert added the Team:Elastic-Agent Label for the Agent team label Jan 8, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

Copy link

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
No Duplication information No data about Duplication

See analysis details on SonarQube

@AndersonQ AndersonQ merged commit bccb12e into elastic:main Jan 22, 2024
6 of 9 checks passed
mergify bot pushed a commit that referenced this pull request Jan 22, 2024
…cess (#4039)

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 bccb12e)
AndersonQ added a commit that referenced this pull request Jan 31, 2024
…cess (#4039) (#4113)

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 bccb12e)

Co-authored-by: Anderson Queiroz <anderson.queiroz@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.12.0 Automated backport with mergify enhancement New feature or request skip-changelog Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants