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

Module update doesn't trigger #113

Closed
bitonio opened this issue Dec 16, 2020 · 3 comments
Closed

Module update doesn't trigger #113

bitonio opened this issue Dec 16, 2020 · 3 comments

Comments

@bitonio
Copy link

bitonio commented Dec 16, 2020

Hello,

When updating an Akamai CLI module (here eaa) the cli command responds with an "already up-to-date".

The issue happened on a Mac running macOS Catalina 10.15.7, akamai cli 1.1.5 and git version 2.24.1 (Apple Git-126).
This machine runs cli-eaa version 0.2.6 (corresponding commit aecd515fa18e1d200797555f446f9c016e895b8f), and the user is willing to upgrade to 0.2.7 (commit 1c166df4ff9480b9f23fce40f8a4886796bad527). See cli-eaa commits in master branch.

% AKAMAI_LOG=trace akamai update eaa
TRACE[0000] Command found: /Users/androcho/.akamai-cli/src/cli-eaa/bin/akamai-eaa
Attempting to update "eaa" command...
TRACE[0000] Searching for package repo
TRACE[0000] Repo found: /Users/androcho/.akamai-cli/src/cli-eaa
TRACE[0000] Fetching from remote: origin
TRACE[0000] Using ref: refs/remotes/origin/master
TRACE[0000] HEAD is the same as the remote: aecd515fa18e1d200797555f446f9c016e895b8f (old) vs aecd515fa18e1d200797555f446f9c016e895b8f (new)
Attempting to update "eaa" command...... [OK]

command "eaa" already up-to-date

Investigating a little bit further, git status in the ~/.akamai-cli/src/cli-eaa directory seems to consider this is the latest.
Changing directory and executing the following fixed the problem:

% git fetch origin && git pull

And we can confirm it is updated:

%  akamai eaa version
0.2.7

Thanks

@lukaszczerpak
Copy link

lukaszczerpak commented Dec 17, 2020

Might be related to src-d/go-git#1143 as we do shallow clone when installing from git and then on update we ignore "object not found" error:

	err = w.Pull(&git.PullOptions{RemoteName: git.DefaultRemoteName})
	if err != nil && err.Error() != "already up-to-date" && err.Error() != "object not found" {
		log.Tracef("Fetch error: %s", err.Error())
		akamai.StopSpinnerFail()
		return cli.NewExitError(color.RedString("Unable to fetch updates (%s)", err.Error()), 1)
	}

I will try to fix it.

UPDATE:
I've tested with go-git v5 and the same issue manifested itself. There is related ticket opened already: go-git/go-git#207

@lukaszczerpak
Copy link

PR: #115

@lkowalsk-akamai-com
Copy link
Contributor

Hi @bitonio , this issue should be fixed now. Please try with latest release and close the ticket.

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

No branches or pull requests

3 participants