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

Documentation - Update Go dependency management doc #3321

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

Conversation

s-fairchild
Copy link
Collaborator

Which issue this PR addresses:

N/A

Fixes

What this PR does / why we need it:

Update documentation to remove instructions to run make vendor. This script was previously required when the ARO installer was vendored, as well as other OCP 4.x dependencies.

Test plan for issue:

Updated Go module dependencies recently with these steps.

Is there any documentation that needs to be updated for this PR?

N/A

Update documentation to remove instructions to run make vendor.
This script was previously required when the ARO installer was vendored, as well as other OCP 4.x dependencies.
calling

```bash
make vendor
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the makefile target be deprecated / removed altogether? I'm curious on if we still need it for anything if we're removing it from docs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was asking myself the same question. I see Ben updated the script a few weeks ago PR #3301

He said it still has some uses, so I don't think we should remove it. Documentation on it's specific purposes and uses would be nice.

Copy link
Contributor

@kimorris27 kimorris27 left a comment

Choose a reason for hiding this comment

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

Don't certain OCP repos still need to be vendored using the script? I'm looking at

ARO-RP/go.mod

Line 740 in 21f0e23

// Installer dependencies. Some of them are being used directly in the RP.
on master and that's why I'm thinking the script is still needed.

But if the premise that we no longer need the script holds, the doc updates LGTM.

@s-fairchild
Copy link
Collaborator Author

Don't certain OCP repos still need to be vendored using the script? I'm looking at

ARO-RP/go.mod

Line 740 in 21f0e23

// Installer dependencies. Some of them are being used directly in the RP.

on master and that's why I'm thinking the script is still needed.

But if the premise that we no longer need the script holds, the doc updates LGTM.

We flushed out that this documentation is outdated in this thread.

Maybe I should remove that comment from go.mod too?

@kimorris27
Copy link
Contributor

Don't certain OCP repos still need to be vendored using the script? I'm looking at

ARO-RP/go.mod

Line 740 in 21f0e23

// Installer dependencies. Some of them are being used directly in the RP.

on master and that's why I'm thinking the script is still needed.
But if the premise that we no longer need the script holds, the doc updates LGTM.

We flushed out that this documentation is outdated in this thread.

Maybe I should remove that comment from go.mod too?

Gotcha, I read through the thread. Based on #3301, it looks like @bennerv didn't remove the whole script, just the part that previously vendored in the custom installer. And reading through the comments at the top of the script (see below), it's not clear to me why we're considering the script deprecated, since the logic explained there seems that it would still apply despite the recent installer-related changes.

So I'm not even sure about the go.mod comment tbh. My intention in going back and forth here is just to help guide us to a point where we're fully confident we're not prematurely deprecating something that we still need.

# TLDR: OCP consists of many repos where for each release a new release branch gets created (release-X.Y).
# When we update vendors we want to get latest changes from the release branch for all of the dependencies.
# With Go modules we can't easily do it, but there is a workaround which consists of multiple steps:
# 1. Get the latest commit from the branch using `go list -mod=mod -m [email protected]`.
# 2. Using `sed`, transform output of the above command into format accepted by `go mod edit -replace`.
# 3. Modify `go.mod` by calling `go mod edit -replace`.
#
# This needs to happen for each module that uses this branching strategy: all these repos
# live under github.com/openshift organisation.
#
# There are however, some exceptions:
# * Some repos under github.com/openshift do not use this strategy.
# We should skip them in this script and manage directly with `go mod`.
# * Some dependencies pin their own dependencies to older commits.
# For example, dependency Foo from release-4.7 branch requires
# dependency Bar at older commit which is
# not compatible with [email protected].

Copy link
Collaborator

@SudoBrendan SudoBrendan left a comment

Choose a reason for hiding this comment

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

I think this introduces some changes that will impact SREs on various OS. Can we get a +1 from both sides?


```bash
# Ensure go module-aware mode is set to auto
export GO111MODULE=auto
Copy link
Collaborator

Choose a reason for hiding this comment

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

My work laptop is fubar so I can't test this myself, but I am 99% sure this breaks re: mac vs linux. Can we get an SRE from each side of the aisle to attempt this change?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Woops, ok, so maybe it was a Linux thing - have my laptop back up and I, for reasons unknown along my dev journey on this team, have changed my GO111MODULE="", I can test this now, so I'll give it a go and see what happens :)


```bash
export GO111MODULE=auto
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above.

@s-fairchild
Copy link
Collaborator Author

@bennerv Can you review this PR when you have a chance?
There's a question in this comment I think you maybe able to answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chainsaw Pull requests or issues owned by Team Chainsaw documentation Improvements or additions to documentation ready-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants