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

cant get pull issuesnumber from gitlab #132

Open
xxholly32 opened this issue May 1, 2019 · 5 comments
Open

cant get pull issuesnumber from gitlab #132

xxholly32 opened this issue May 1, 2019 · 5 comments

Comments

@xxholly32
Copy link

hi, i found some different between github and gitlab

code line

export function listCommits(from: string, to: string = ""): CommitListItem[] {
  // Prints "<short-hash>;<ref-name>;<summary>;<date>"
  // This format is used in `getCommitInfos` for easily analize the commit.
  return execa
    .sync("git", ["log", "--oneline", "--pretty=%h;%D;%s;%cd", "--date=short", `${from}..${to}`])
    .stdout.split("\n")
    .filter(Boolean)
    .map((commit: string) => {
// commit:
// github : 5279caa;;Merge pull request #3 from xx-helloworld/dev;2019-04-22
// gitlab: 73ba6ec;;Merge branch 'dev' into 'master';2019-04-28
// i cant get number #3 at gitlab
      const parts = commit.split(";");
      const sha = parts[0];
      const refName = parts[1];
      const summary = parts[2];
      const date = parts[3];
      return { sha, refName, summary, date };
    });
}

use gitlab api i cant get gitlab merge_request(pull) number. so help me 🙀 !

my pr repo and gitlab test demo

thank you and forgive my broken english

@AtarisMio
Copy link

真巧,,,我也在改这个23333,我是靠查某一天的提交,然后再比对sha,,,感觉很low,如果你有好的想法,还请告诉我。

What a coincidence, I also changed this repo, LOL, I rely on, checking merge request in commit date, and then compare commit-sha, very inefficient. If you have a good idea, please tell me.

@AtarisMio
Copy link

@xxholly32
我最近发现commits的api有提供通过commit的sha区查询相关merge request的功能

https://docs.gitlab.com/ee/api/commits.html#list-merge-requests-associated-with-a-commit

我现在可以通过commit的sha查询相关的merge request了

@xxholly32
Copy link
Author

xxholly32 commented May 27, 2019

@AtrisMio 感谢提供技术支持

但这个api还是对应的是commit,为主导;而不是issues或者merge request为主导。当然并不是不能实现,只是感觉不是最优解,pr最好得到官方的支持,或者是否还有别的更好的方案。

@AtrisMio ty for your support.

But this API still start with Commit; rather than Issues or Merge request. it is not impossible to achieve, but i think it is not the best solution. It is better for pr to get official support, or whether there are other better solutions.

@pmjhonwang
Copy link

@xxholly32
what's going on about this issue?

can I use this package instead?
https://github.com/olehan/lerna-changelog#readme

@xxholly32
Copy link
Author

@pmjhonwang i dont think olehans repo can work. In my opinion , there have deffierent info from git log`

// github : 5279caa;;Merge pull request #3 from xx-helloworld/dev;2019-04-22
// gitlab: 73ba6ec;;Merge branch 'dev' into 'master';2019-04-28
// i cant get number #3 at gitlab

but i hadn`t try his repo,hopes i was wrong. sorry i not focus on this for long time 🤒

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

No branches or pull requests

3 participants