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

New tag message is shown when a tag is deleted #232

Open
hanzei opened this issue Nov 19, 2020 · 16 comments · May be fixed by #524
Open

New tag message is shown when a tag is deleted #232

hanzei opened this issue Nov 19, 2020 · 16 comments · May be fixed by #524
Assignees
Labels
Difficulty/2:Medium Medium ticket Good First Issue Suitable for first-time contributors Hacktoberfest Help Wanted Community help wanted Tech/Go Type/Bug Something isn't working
Milestone

Comments

@hanzei
Copy link
Collaborator

hanzei commented Nov 19, 2020

It writes "New tag" also when I delete a tag.

Output looks like this when I push a new tag and when i push --delete a tag: https://paste.ee/p/xwvbQ

Issue created from a Mattermost message by @martbhell.

@hanzei hanzei added Difficulty/2:Medium Medium ticket Good First Issue Suitable for first-time contributors Help Wanted Community help wanted Tech/Go Type/Bug Something isn't working Up For Grabs Ready for help from the community. Removed when someone volunteers labels Nov 19, 2020
@martbhell
Copy link

martbhell commented Nov 19, 2020

For posterity:

Commands used (and duplicates because duplicate webhooks..):

$ git tag -s v1.0.4 
$ git push origin v1.0.04
$ git push --delete v1.0.4

Content of the pastee:

08:19
johan/dotfiles New tag v1.0.4 by Johan Guldmyr: 4
-----BEGIN PGP SIGNATURE-----
MYSIG
-----END PGP SIGNATURE-----

08:19
johan/dotfiles New tag v1.0.4 by Johan Guldmyr: 4
-----BEGIN PGP SIGNATURE-----

MYSIG

-----END PGP SIGNATURE-----

08:20
johan/dotfiles New tag v1.0.4 by Johan Guldmyr:

08:20
johan/dotfiles New tag v1.0.4 by Johan Guldmyr:
~                                                   

@Quaqmre
Copy link

Quaqmre commented Jan 30, 2021

I would like to work on it.

@hanzei
Copy link
Collaborator Author

hanzei commented Feb 8, 2021

Awesome, thanks @Quaqmre 👍

@hanzei hanzei removed the Up For Grabs Ready for help from the community. Removed when someone volunteers label Feb 8, 2021
@Quaqmre
Copy link

Quaqmre commented Feb 14, 2021

Hi guys , I was working on this issue then I find some that ,It is not related webhoos or Mattermost api , when u try to delete tag remotely like ' git push --delete anytag' that is deleted gitlab remoot repo but anytag still there in your local repo. And when u try to push or delete any tag git add the *anytag" again.Then u saw 2 message on your channel 1 message about deleted mesage the other one is brendnew tag with the same name deleted one. Because u have the deleted tag in your local repo.When u delete tags remotely u have to delete in your local repo.

I will upload screenshot tomorrow morning :)

@hanzei
Copy link
Collaborator Author

hanzei commented Feb 15, 2021

@jsmestad In order to delete a tag locally and remotely, you have to also run git tag -d anytag.

@Quaqmre
Copy link

Quaqmre commented Feb 15, 2021

commandAndWebbHook

@hanzei
Copy link
Collaborator Author

hanzei commented Feb 15, 2021

That seems like the expected behavior to me. git push will publish v4 again, given that it was not deleted locally.

@Quaqmre
Copy link

Quaqmre commented Feb 19, 2021

@hanzei How should we proceed about this issue ? Can you help me what should i do ?

@hanzei
Copy link
Collaborator Author

hanzei commented Feb 19, 2021

@Quaqmre The example looks good to me. The notifications appear in the right order. Would you please create a WIP PR for an early code review?

@Quaqmre
Copy link

Quaqmre commented Feb 27, 2021

@hanzei Actually I dont know how can I create WIP PR , I try to create PR but I dont have any commit or changes ,so I cant create PR without changes what sould I do ?

` Showing with 0 additions and 0 deletions.

No commit comments for this range
`
I got those messages.After click create new Pull Request.

@martbhell
Copy link

martbhell commented Mar 1, 2021

@Quaqmre Are you saying that you are unable to reproduce the issue?

Unfortunately, I cannot test this as I'm on holiday, but I can try again in like 3-4 weeks.

@hanzei
Copy link
Collaborator Author

hanzei commented Mar 1, 2021

@Quaqmre To which branch did you pushed your changes? Did you tried creating the PR via https://github.com/mattermost/mattermost-plugin-gitlab/compare?

@martbhell
Copy link

I can still reproduce this with:

In a private mattermost 5.28.1 channel (and gitlab plugin 1.3.0) I ran:
/gitlab subscribe johan/dotfiles tag

Then in my git repo I ran:

$ git tag v1.0.7
$ git push origin v1.0.7
Total 0 (delta 0), reused 0 (delta 0)
To mygitlab.example.org:johan/dotfiles.git
 * [new tag]         v1.0.7 -> v1.0.7
 *
$  git push origin --delete v1.0.7
To mygitlab.example.org:johan/dotfiles.git
 - [deleted]         v1.0.7

Resulted in these two gitlab notifications:

08:42
johan/dotfiles New tag v1.0.7 by : 

08:43

johan/dotfiles New tag v1.0.7 by : 

@mickmister mickmister added this to the Planned Work milestone Jan 26, 2022
@DHaussermann
Copy link

For this issue - There may value in continuing to deliver the tag deletion events.

An alternative may simply be to clarify this behavior in the help. @aaronrothschild may have some thoughts here.
cc @Quaqmre ☝️

@Kshitij-Katiyar
Copy link
Contributor

@DHaussermann @wiggin77
I looked into the issue and would like to share my findings.

  • The webhook event sent by GitLab in both cases (creation and deletion of a tag) is identical. Unfortunately, no parameter in the webhook payload indicates whether the tag push event is a creation or deletion event.
  • One potential solution is to make an additional API call to retrieve the commit data, which might help us differentiate between these types of events.

Please let us know if making an extra API call is a viable approach to resolving this issue and whether we should proceed in this direction.`

@wiggin77
Copy link
Member

wiggin77 commented Sep 3, 2024

  • One potential solution is to make an additional API call to retrieve the commit data, which might help us differentiate between these types of events.

@Kshitij-Katiyar Let's try and see if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty/2:Medium Medium ticket Good First Issue Suitable for first-time contributors Hacktoberfest Help Wanted Community help wanted Tech/Go Type/Bug Something isn't working
Projects
None yet
9 participants