Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I prevent annotated tags being converted to lightweight tags?

Glen Carl August 24, 2016

I am successful at creating annotated tags in Bitbucket, however, in less than a minute, the annotated tag changes to a lightweight tag. Is there a reason why the annotated tag would automatically convert to a lightweight tag with no user intervention? How to you prevent the automated transition to a lightweight tag?

3 answers

1 accepted

1 vote
Answer accepted
PaulT August 24, 2016

Hi Glen,

I work in the Bitbucket team that implemented that feature, and that doesn't describe any known part of the feature, so I'm interested in how this might be occurring too! 

When using the Bitbucket UI to create a tag, a lightweight tag will be created when you add an annotation, but no message. If you add any message in the provided dialog, then the tag will be created as an annotated tag.

If this doesn't describe what you're running into, I'd be interested in finding out how you're creating this tag, whether it be via the git command line, the REST api, or the Bitbucket web UI. 

Cheers

Paul

Glen Carl August 25, 2016

Bitbucket v4.3.0

Project is a migration from SVN, and still linked to SVN

Method 1
Bitbucket UI
* select commits
* select master in commits (and probably is not needed)
* select merge commit for the merge to master
	** a release branch was created from develop branch
    ** this was merged into release
* selected "Tag this Commit"
* Entered Tag name "2.0.1"
* Entered Description "Release 2.0.1 PROJ-123"
* Click tags, there it is an annotated tag
* Click tags, "Where did the annotated tag go?" 
 
Method 2
git checkout master
git tag -a 2.0.1 -m "anno master PROJ-123" master
git push --tags
 
Method 3
git checkout master
git tag -a v2.0.1 -m "Annotated version PROJ-123"
git push origin v2.01

 

Each method generated the annotated tag. Then when clicking tags a second time the annotated tag vanishes. On my source side, 

git fetch --all
git tag
* no annotated tags

 

The annotated tags definitely disappear on the Bitbucket JIRA suite for team's project. Other projects on the same suite succeed in retaining the annotated tags they generate. 

 

Glen Carl August 25, 2016

Note, I tried to create a lightweight tag with  the Bitbucket UI by not entering name/description. The UI responded by requiring the entry of name/description. I have not succeeded in creating a lightweight tag from the Bitbucket UI, only via git. 

PaulT August 25, 2016

Hi Glen,

Attempting this myself, you should be able to add a tag just with a name and no description. That will create a lightweight tag, see as follows:

image2016-8-26 9:4:22.png

As for the behaviour you're finding with the disappearing tags, that sounds very strange. Pushing a tag via git push --tags should work. If you're interested you can open a support case at http://support.atlassian.com and we can see if we can dive into the cause.

Cheers

Paul

Glen Carl August 25, 2016

Oops, I just remembered I did not enter the Tag name. However, I am not concerned with creating lightweight tags, that has been working. I am having problems with the annotated tags. Where entering a tag name and description fails.

Glen Carl August 25, 2016

Well, creating the lightweight with the UI did fail with just the tag name. I guess I need to open issue with Atlassian. Are you sure there is not a setting that blocks tag creations with the UI or for certain types of commits?

image2016-8-25 18:39:31.png

Glen Carl August 25, 2016

I tried another commit, and notice the red asterisk * for the for entry which is a UI standard for required values. Therefore, why is the Description field requiring an entry.

PaulT August 25, 2016

Hi Glen,

Just having a look, you're on Bitbucket 4.3 which doesn't ship with inbuilt support for tags. Therefore the tag support your currently receiving is via a plugin. Integrated support for tags shipped in 4.7. 

If you're after Bitbucket web ui support for tags, you'll need to upgrade to 4.7 or 4.8. Once upgraded you'll most likely want to uninstall the plugin that provides duplicate functionality.

Cheers

Paul

Glen Carl August 26, 2016

Hi Paul,

Your analysis sounds possible. To fully understand, one 'project' could be using the plugin, and my 'project' has not set up the plugin. I will check with the other project team admin to see if he has a tag plugin.

Thanks,

Glen

Glen Carl August 26, 2016

Discovered we are using Calmware v1.5.4, and it enforces the "tag name" and "description" entry. It is not working for my project. I am pushing for our JIRA Suite group to update Atlassian, and removing the Calmware.

Glen Carl September 7, 2016

We upgraded to Bitbucket v4.9.1 and diabled the pluggin. However, not I cannot create a Lightweight or Annotated tag for my project. Do we have to uninstall the Calmware plugin? 

Glen Carl September 8, 2016

found the trouble. We had a "Push Check" Hook enabled. Disabling the hook for the tag creation solved the creation of tags from the Bitbucket commit.

0 votes
Glen Carl September 8, 2016

Verify your Pre receive Hooks are not blocking your tag. You may have to disable your "Push Check" hook to add your tag. The git push origin <tag_name> gave me a message to show the hook was enabled, and blocking my tag push. 

It would be nice if the Bitbucket error messging would notify the user when the tag is blocked by the "Push Check" hook. Currently, on v4.9.1, I did not see an error message to check the hook, and it was mystery why the tag would fail or not annotate.

With git you get the following message

! [remote rejected] tag_name -> tag_name (pre-receive hook declined)

0 votes
Glen Carl August 24, 2016

Some members on another project with the same JIRA Suite are successful with the annotated tag. Is there a project configuration or user setting that prevents annotated tags?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events