mattermost / mattermost-plugin-gitlab Goto Github PK
View Code? Open in Web Editor NEWGitLab plugin for Mattermost
License: Apache License 2.0
GitLab plugin for Mattermost
License: Apache License 2.0
When I had merge #64 the ci was not working. And i have introduced a regression in tests... ๐
Correction is trivial ;)
When clicking the gitlab icon on the left side it opens up the plugin page for github instead
https://mattermost.local.domain/plugins/github/oauth/connect
/gitlab settings [setting] [value]
provides no feedback in the form of an ephemeral post that anything has happened.
There should be feedback that this change was saved.
When OnConfigurationChange in server arrive we must prevent all user connected (web socket) to reload conf
Need to rebuild a gitlabClient when configuration change if organisation or privateEnable has change
https://github.com/mattermost/mattermost-plugin-sample/
If a user want to link to gitlab.com
and gitlab.perso.com
clone repo, change manifest id, recompile, add to mattermost, configure
have list in plugin settings
In CI we can :
_2
at end and build_3
at end and build_4
at end and buildUser can add enough instance of this plugin and configure them.
As mattermost do the job of isolation in KVStore
and reducers
all should work.
Wheb running /gitlab connect
and signing in I get the approval page to authorize access to my account.
After clicking on approve I get a page with only:
invalid character '<' looking for beginning of value
This is the error I see in the mattermost logs:
{"level":"error","ts":1557431585.4238338,"caller":"mlog/sugar.go:23","msg":"can't exchange state","plugin_id":"com.github.manland.mattermost-plugin-gitlab","err":"invalid character '<' looking for beginning of value"}
First of, let me write this appreciation message! We love this plugin.
The problem we have is that when we add the webhook to many repos, the plugin will only show the first repo where the webhook was added. I've tried reenabling the plugin, restarting mattermost, readding the webhoo, but it all fails. Is this a bug or am I doing something wrong?
And maybe release, see mattermost-plugin-github for inspiration
Unable to find this part nor any identical settings as described here:
I just realized now this is the old readme that applies to github mostly maybe thats why I do not find all menus like described ** updated **
**```
Go to the settings page of your GitLab group and click on "Webhooks" in the sidebar
Click "Add webhook" WHERE is this area Gitlab Group??? <=
Change content type to "application/json" <= Where is this? Maybe adding a Print screen visual or GIF or short video, very confusing this readme .
Select the events: Issues, Issue comments, Pull requests, Pull request reviews, Pull request review comments, Pushes, Branch or Tag creation and Branch or Tag deletion
I am curious where are your events taken from... Again confusing here while I could never match all events you described.
https://community.mattermost.com/core/pl/qa1eeyiutpra5dri8574qnws1c
Maybe add compatibility with gitlab too!?
As a user (before I dev this plugin) I didn't know how to add a project to listen to in github-plugin. I didn't read the readme... meaculpa. But I think to be more easy to use we should add webhook for user. Like that user just /gitlab subscribe owner/project
and all the magic make the job.
Obviously for group, we need to fetch all projects and add it to every repos. If user create a new project after this init step we will miss it... maybe we can cron a synchronizer...
https://docs.gitlab.com/ce/api/projects.html#add-project-hook
What about support for subscriptions on entire subgroups or subgroup projects?
Setting the plugin up works as expected, /gitlab connect
works up to the point where I can click
Authorize
.
After that, I get redirected to a blank page:
Post https://<my-git-url>/oauth/token: x509: certificate signed by unknown authority
In the serverlog I can only see the same error:
{"level":"error","ts":1566657710.0417624,"caller":"mlog/sugar.go:23","msg":"can't exchange state","plugin_id":"com.github.manland.mattermost-plugin-gitlab","err":"Post https://<my-git-url>/oauth/token: x509: certificate signed by unknown authority"}
If I can supply you with any more information, please let me know.
Using the latest version of mattermost and your plugin.
Other services often have an option for untrusted connections, which do work.
This property is copied from mattermost-plugin-github
and because in github all on-premise instances are entreprise grade, the name is good. But gitlab can have on-premise without etreprise lincence.
I propose to rename it Gitlab URL
with https://gitlab.com
as default value, without optional.
A plugin of gitlab in github...
Pro :
Cons :
Seems like using subscribe without providing a feature will subscribe to all which is good. But, it also seems like there is validation missing when subscribing to an individual feature.
When I include an invalid feature it is ignored and I get a success message. /gitlab subscribe owner dkh-test-group NotaFeature
This should provide feedback that the feature was invalid and was ignored.
On issue with this setup is that the caching doesn't work. The orb expects the go.mod
file to be at /go.mod
. But in this project it's at /server/go.mod
.
I see
Possible options:
go.mod
into the root directory@manland Thoughts on this?
Originally posted by @hanzei in #69 (comment)
When the 'unsubscribe' command does nothing because the repo was incorrect, the users still get's a success message.
/gitlab unsubscribe fake-repo
The user should receive a message that they are not subscribed to any such repo,
Instead of subscribing to a repo I've subscribed to the entire organization. Now I'd like to unsubscribe from the organization because it causes too much noise in our main channel. I can't seem to be able to unsubscribe:
I've tried subscribing/unsubscribing from repos and that works, I only seem to get this problem with organizations. Is there a trick to remove that subscription ?
With the help of channel header user could see what owner/project
are linked, and add new one.
I submitted a PR that updates the strings in plugins.json, but there may be other occurrences of it https://github.com/manland/mattermost-plugin-gitlab/pull/30
Mattermost 5.10 introduces bot accounts. A bot account should be created on startup and used. The setting Username
an be removed.
Encountered an error when extracting the plugin. Review your plugin file content and try again.
Check all web hook and commands in relation with gitlab for inactivation for private project
The structure of the webhook events messages isn't very consistent. E.g.:
Comment on an issue:
$REPO New comment by $AUTHOR on $ISSUE_NUMBER $ISSUE_NAME
$CONTENT
Close issue:
[$REPO] Issue $ISSUE_NUMBER closed by $AUTHOR`
Opening an issue:
#### $ISSUE_NAME
##### $REPO/$ISSUE_NUMBER
# new issue by $AUTHOR on $TIMESTAP
MR events are structure similarly.
My proposal would be:
[$REPO]
and link to the repo@
before username####
as the maximum headingHelp for the command is provided in the form of a DM from the BOT once connected but, it would also be good to have /gitlab help available to the user before they authenticate to show connect and the other commands.
On the System Console page, we should add an example to the Gitlab group field? This would make it clear if the field is expecting the URL to the group or simply the name.
The setup guide should to be updated to use the new BOT accounts functionality. This functionality will be exposed in the UI for 5.12
Section 4. - step ii.
Create a new Mattermost user, through the regular UI or the CLI with the username "gitlab"
This should be updated for 5.12 to instruct the user to navigate to the integrations section and create a new bot instead of a user account that functions as a BOT.
When using custom "Enterprise Base URL" it seems that it pre-pends api/v3 before the api/v4 url.
Getting this error when trying to authorize the plugin after /gitlab connect
:
GET https://gitlab.local.domain/api/v3/api/v4/user: 410 {error: API V3 is no longer supported. Use API V4 instead.}
Check if all endpoints and web hook are limited when group limitation is on
It it seems like even when Enable Private Repositories
set to false, I can subscribe to private repos. I ensured that the plugin was restarted after the flag was set to False and saw the same result.
note: It's possible this could just be incorrect feedback returned by the subscribe command
/gitlab subscribe owner dkh-test-group/dkh-project2
Original github-plugin impelmentation :
func (p *Plugin) postPushEvent(event *github.PushEvent) {
config := p.getConfiguration()
repo := event.GetRepo()
subs := p.GetSubscribedChannelsForRepository(ConvertPushEventRepositoryToRepository(repo))
if len(subs) == 0 {
return
}
userID := ""
if user, err := p.API.GetUserByUsername(config.Username); err != nil {
mlog.Error(err.Error())
return
} else {
userID = user.Id
}
forced := event.GetForced()
branch := strings.Replace(event.GetRef(), "refs/heads/", "", 1)
commits := event.Commits
compare_url := event.GetCompare()
pusher := event.GetSender()
if len(commits) == 0 {
return
}
fmtMessage := ``
if forced {
fmtMessage = "[%s](%s) force-pushed [%d new commits](%s) to [\\[%s:%s\\]](%s/tree/%s):\n"
} else {
fmtMessage = "[%s](%s) pushed [%d new commits](%s) to [\\[%s:%s\\]](%s/tree/%s):\n"
}
newPushMessage := fmt.Sprintf(fmtMessage, pusher.GetLogin(), pusher.GetHTMLURL(), len(commits), compare_url, repo.GetName(), branch, repo.GetHTMLURL(), branch)
for _, commit := range commits {
newPushMessage += fmt.Sprintf("[`%s`](%s) %s - %s\n",
commit.GetID()[:6], commit.GetURL(), commit.GetMessage(), commit.GetCommitter().GetName())
}
post := &model.Post{
UserId: userID,
Type: "custom_git_push",
Props: map[string]interface{}{
"from_webhook": "true",
"override_username": GITHUB_USERNAME,
"override_icon_url": config.ProfileImageURL,
},
Message: newPushMessage,
}
for _, sub := range subs {
if !sub.Pushes() {
continue
}
post.ChannelId = sub.ChannelID
if _, err := p.API.CreatePost(post); err != nil {
mlog.Error(err.Error())
}
}
}
Originally posted by @hanzei in https://github.com/manland/mattermost-plugin-gitlab/pull/5#discussion-diff-275288604R365
You can use GetBundlePath
for this.
Originally posted by @hanzei in https://github.com/manland/mattermost-plugin-gitlab/pull/5
When mattermost 5.10 is out
Add default :
return []*HandleWebhook{{From: senderGitlabUsername}}, nil
to all web hook handler to refresh left summary compo for author
Find a way to prevent author and assignee when issue has updated label
Originally posted by @hanzei in https://github.com/manland/mattermost-plugin-gitlab/pull/5#discussion-diff-275289274R319
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.