# Docker-manager plugin not linking to github properly

**URL:** https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308
**Category:** Bug
**Created:** [November 1, 2016, 4:47pm UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308 "2016-11-01T16:47:11Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [November 1, 2016, 4:47pm UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/1 "2016-11-01T16:47:11Z")

</div>

I have a standard docker-based installation, and use the docker-manager plugin to keep things up to date. This works fine for most plugins, but for some reason some of the plugins don’t work properly. The link to the commit is wrong, but actually updating works fine.

So, for the discourse-solved plugin, the generated HTML looks like

```plaintext
<td>
  discourse-solved
  (<a href="https://github.com/discourse/discourse-solved/compare/9936707...master">9936707</a>)
</td>

```

and that works fine.

However, for the discourse-push-notifications plugin, it looks like this

```plaintext
<td>
  discourse-push-notifications
  (<a href="/compare/003519a...master">003519a</a>)
</td>

```

The problem isn’t isolated to that plugin, it also happens for discourse-migrate-password, and a plugin of my own.

All the plugins were initially installed by including a git clone line in the app.yml container definition. As far as I can tell they are all in the same state as each other so no idea what’s causing the difference.

If I enter the docker container, and go to the directory of the plugins, running `git config --get remote.origin.url` returns

```plaintext
https://github.com/discourse/discourse-push-notifications

```

There are no errors in the javascript or server logs. Is there anywhere else I can look to try and figure out what’s going on?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 1, 2016, 9:10pm UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/2 "2016-11-01T21:10:50Z")

</div>

I can’t recreate this. I added discourse-push-notifications to my instance and it doesn’t exhibit this behavior.

If you open dev tools, do you see any errors?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [November 1, 2016, 11:29pm UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/3 "2016-11-01T23:29:02Z")

</div>

> [@cpradio](#):
>
> If you open dev tools, do you see any errors?

Got nothing in the javascript console, and don’t really have any idea how to investigate the problem further. The issue persists for me even after a full rebuild of the container.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 1, 2016, 11:32pm UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/4 "2016-11-01T23:32:52Z")

</div>

What other plugins do you have installed (can you copy and paste that section of your app.yml)? Have you made any customizations to the /var/discourse/templates area?

… trying to think of other possibilities…

Have you tried using incognito mode with all extensions disabled?

What version of Discourse are you running? and which branch are you following?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [November 2, 2016, 12:11am UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/5 "2016-11-02T00:11:54Z")

</div>

Think I’ve tracked it down. It breaks for repositories that have been cloned without the URL ending in `.git`

(I cloned by doing `git clone https://github.com/discourse/discourse-push-notifications` instead of `https://github.com/discourse/discourse-push-notifications.git`)

I believe the line causing this is line 9 here:  
[https://github.com/discourse/docker\_manager/blob/master/manager-client/app/helpers/fmt-commit.js#L9](https://github.com/discourse/docker_manager/blob/master/manager-client/app/helpers/fmt-commit.js#L9)

If the URL doesn’t contain `.git` then `url.indexOf` returns -1, and so `url.substr(0,-1)` returns an empty string.

Something like this might work (but there’s probably a tidier way):

```plaintext
var extension = url.indexOf('.git')
if (extension == -1){
    var _url = url  	
}else{
    var _url = url.substr(0, extension);	
}

```

Unfortunately I can’t manage to build `docker-manager/manager-client` in my dev environment so I can’t test this or do a pull request ☹

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 2, 2016, 10:23am UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/6 "2016-11-02T10:23:57Z")

</div>

Cool, that sounds like a simple repro step. I’ll look into submitting that PR once I recreate it 🙂 Might not happen today though.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 2, 2016, 1:11pm UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/7 "2016-11-02T13:11:53Z")

</div>

PR created  
[https://github.com/discourse/docker\_manager/pull/32](https://github.com/discourse/docker_manager/pull/32)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [December 9, 2016, 1:13pm UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/8 "2016-12-09T13:13:25Z")

</div>

Any chance of getting this merged in @eviltrout @cpradio?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [December 9, 2016, 3:41pm UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/9 "2016-12-09T15:41:19Z")

</div>

It looks like the assets weren’t compiled yet. I posted another comment on the commit.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [December 9, 2016, 5:40pm UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/10 "2016-12-09T17:40:38Z")

</div>

No, they are. I added them to the PR a while ago. I’ve been using my branch in my sandbox for over a month without any issues.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 9, 2016, 8:13pm UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/11 "2016-12-09T20:13:39Z")

</div>


