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

The gitlab API merge request URL has an additional single quote #577

Open
ta0chen opened this issue Aug 1, 2023 · 8 comments
Open

The gitlab API merge request URL has an additional single quote #577

ta0chen opened this issue Aug 1, 2023 · 8 comments
Labels

Comments

@ta0chen
Copy link

ta0chen commented Aug 1, 2023

Current behavior

I recently implemented the semantic-release v21.0.7 into my project hoping it can help to automatically bump the release version. The version can be generated. But I found a serious problem in the semantic-release. The thing is the semantic-release was trying to post comments to related issues and merge requests. But it was using a wrong URL which contained an additional single quote at the end. Below is the console output from the pipeline for your reference. I asked my IT to double confirm this strange thing from the gitlab backend log. So, I believe it should be a defect in semantic-release side.

[4:43:51 AM] [semantic-release] [@semantic-release/gitlab] › ✘  An error occurred while posting comments to related issues and merge requests:
HTTPError: Response code 502 (Bad Gateway)
    at Request.<anonymous> (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:629:26)
    at Request.emit (node:events:526:35)
    at Request._onResponseBase (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:726:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Request._onResponse (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:768:13) {
  input: undefined,
  code: 'ERR_NON_2XX_3XX_RESPONSE',
  timings: {
    start: 1690865029199,
    socket: 1690865029199,
    lookup: 1690865029451,
    connect: 1690865030272,
    secureConnect: 1690865031046,
    upload: 1690865031119,
    response: 1690865031193,
    end: 1690865031194,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 0,
      dns: 252,
      tcp: 821,
      tls: 774,
      request: 73,
      firstByte: 74,
      download: 1,
      total: 1995
    }
  },
  options: {
    request: undefined,
    agent: { http: undefined, https: undefined, http2: undefined },
    h2session: undefined,
    decompress: true,
    timeout: {
      connect: undefined,
      lookup: undefined,
      read: undefined,
      request: undefined,
      response: undefined,
      secureConnect: undefined,
      send: undefined,
      socket: undefined
    },
    prefixUrl: '',
    body: undefined,
    form: undefined,
    json: undefined,
    cookieJar: undefined,
    ignoreInvalidCookies: false,
    searchParams: undefined,
    dnsLookup: undefined,
    dnsCache: undefined,
    context: {},
    hooks: {
      init: [],
      beforeRequest: [],
      beforeError: [],
      beforeRedirect: [],
      beforeRetry: [],
      afterResponse: []
    },
    followRedirect: true,
    maxRedirects: 10,
    cache: undefined,
    throwHttpErrors: true,
    username: '',
    password: '',
    http2: false,
    allowGetBody: false,
    headers: {
      'user-agent': 'got (https://github.com/sindresorhus/got)',
      'private-token': '[secure]',
      accept: 'application/json',
      'accept-encoding': 'gzip, deflate, br'
    },
    methodRewriting: false,
    dnsLookupIpVersion: undefined,
    parseJson: [Function: parse],
    stringifyJson: [Function: stringify],
    retry: {
      limit: 2,
      methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ],
      statusCodes: [
        408, 413, 429, 500,
        502, 503, 504, 521,
        522, 524
      ],
      errorCodes: [
        'ETIMEDOUT',
        'ECONNRESET',
        'EADDRINUSE',
        'ECONNREFUSED',
        'EPIPE',
        'ENOTFOUND',
        'ENETUNREACH',
        'EAI_AGAIN'
      ],
      maxRetryAfter: undefined,
      calculateDelay: [Function: calculateDelay],
      backoffLimit: Infinity,
      noise: 100
    },
    localAddress: undefined,
    method: 'GET',
    createConnection: undefined,
    cacheOptions: {
      shared: undefined,
      cacheHeuristic: undefined,
      immutableMinTimeToLive: undefined,
      ignoreCargoCult: undefined
    },
    https: {
      alpnProtocols: undefined,
      rejectUnauthorized: undefined,
      checkServerIdentity: undefined,
      certificateAuthority: undefined,
      key: undefined,
      certificate: undefined,
      passphrase: undefined,
      pfx: undefined,
      ciphers: undefined,
      honorCipherOrder: undefined,
      minVersion: undefined,
      maxVersion: undefined,
      signatureAlgorithms: undefined,
      tlsSessionLifetime: undefined,
      dhparam: undefined,
      ecdhCurve: undefined,
      certificateRevocationLists: undefined
    },
    encoding: undefined,
    resolveBodyOnly: false,
    isStream: false,
    responseType: 'text',
    url: URL {
      href: 'https://onecode.polycom-labs.com/api/v4/projects/video-endpoints%2Ftools%2Felement-framework/repository/commits/196c9be4433702c4195ab9ca776bc18d360243df/merge_requests',
      origin: '[https://onecode.polycom-labs.com'](https://onecode.polycom-labs.com%27/),
      protocol: 'https:',
      username: '',
      password: '',
      host: 'onecode.polycom-labs.com',
      hostname: 'onecode.polycom-labs.com',
      port: '',
      pathname: '/api/v4/projects/video-endpoints%2Ftools%2Felement-framework/repository/commits/196c9be4433702c4195ab9ca776bc18d360243df/merge_requests',
      search: '',
      searchParams: URLSearchParams {},
      hash: ''
    },
    pagination: {
      transform: [Function: transform],
      paginate: [Function: paginate],
      filter: [Function: filter],
      shouldContinue: [Function: shouldContinue],
      countLimit: Infinity,
      backoff: 0,
      requestLimit: 10000,
      stackAllItems: false
    },
    setHost: true,
    maxHeaderSize: undefined,
    signal: undefined,
    enableUnixSockets: false
  }
}

Expected behavior

The semantic-release should take care of the URL properly and make sure it does not contain some illegal characters. Take the URL for an example which I picked from the log, it really contains the single quote.

https://onecode.polycom-labs.com%27/

semantic-release version

21.0.7

CI environment

gitlab

Plugins used

@semantic-release/git @semantic-release/gitlab @semantic-release/gitlab-config @semantic-release/exec

semantic-release configuration

plugins:
  - "@semantic-release/commit-analyzer"
  - "@semantic-release/release-notes-generator"
  - - "@semantic-release/exec"
    - verifyReleaseCmd: 'mvn versions:set -DnewVersion="${nextRelease.version}" && echo "NEXT_VERSION=${nextRelease.version}" >> build.env'
  - "@semantic-release/gitlab"
  - -  "@semantic-release/git"
    - assets:
        - pom.xml
      message: "chore(release): bump ${nextRelease.version}"

branches:
  - "EN-243881"
  - "+([0-9])?(.{+([0-9]),x}).x"

CI logs

[4:43:24 AM] [semantic-release] › ✔  Completed step "verifyRelease" of plugin "@semantic-release/exec"
[4:43:24 AM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[4:43:25 AM] [semantic-release] › ✔  Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[4:43:25 AM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/exec"
[4:43:25 AM] [semantic-release] › ✔  Completed step "generateNotes" of plugin "@semantic-release/exec"
[4:43:25 AM] [semantic-release] › ℹ  Start step "prepare" of plugin "@semantic-release/exec"
[4:43:25 AM] [semantic-release] › ✔  Completed step "prepare" of plugin "@semantic-release/exec"
[4:43:25 AM] [semantic-release] › ℹ  Start step "prepare" of plugin "@semantic-release/git"
[4:43:26 AM] [semantic-release] [@semantic-release/git] › ℹ  Found 1 file(s) to commit
[4:43:27 AM] [semantic-release] [@semantic-release/git] › ℹ  Prepared Git release: v1.0.0
[4:43:27 AM] [semantic-release] › ✔  Completed step "prepare" of plugin "@semantic-release/git"
[4:43:27 AM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[4:43:29 AM] [semantic-release] › ✔  Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[4:43:29 AM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/exec"
[4:43:29 AM] [semantic-release] › ✔  Completed step "generateNotes" of plugin "@semantic-release/exec"
[4:43:33 AM] [semantic-release] › ✔  Created tag v1.0.0
[4:43:33 AM] [semantic-release] › ℹ  Start step "publish" of plugin "@semantic-release/exec"
[4:43:33 AM] [semantic-release] › ✔  Completed step "publish" of plugin "@semantic-release/exec"
[4:43:33 AM] [semantic-release] › ℹ  Start step "publish" of plugin "@semantic-release/gitlab"
[4:43:34 AM] [semantic-release] [@semantic-release/gitlab] › ℹ  Published GitLab release: v1.0.0
[4:43:34 AM] [semantic-release] › ✔  Completed step "publish" of plugin "@semantic-release/gitlab"
[4:43:34 AM] [semantic-release] › ℹ  Start step "success" of plugin "@semantic-release/exec"
[4:43:34 AM] [semantic-release] › ✔  Completed step "success" of plugin "@semantic-release/exec"
[4:43:34 AM] [semantic-release] › ℹ  Start step "success" of plugin "@semantic-release/gitlab"
[4:43:51 AM] [semantic-release] [@semantic-release/gitlab] › ✘  An error occurred while posting comments to related issues and merge requests:
HTTPError: Response code 502 (Bad Gateway)
    at Request.<anonymous> (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:629:26)
    at Request.emit (node:events:526:35)
    at Request._onResponseBase (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:726:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Request._onResponse (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:768:13) {
  input: undefined,
  code: 'ERR_NON_2XX_3XX_RESPONSE',
  timings: {
    start: 1690865029199,
    socket: 1690865029199,
    lookup: 1690865029451,
    connect: 1690865030272,
    secureConnect: 1690865031046,
    upload: 1690865031119,
    response: 1690865031193,
    end: 1690865031194,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 0,
      dns: 252,
      tcp: 821,
      tls: 774,
      request: 73,
      firstByte: 74,
      download: 1,
      total: 1995
    }
  },
  options: {
    request: undefined,
    agent: { http: undefined, https: undefined, http2: undefined },
    h2session: undefined,
    decompress: true,
    timeout: {
      connect: undefined,
      lookup: undefined,
      read: undefined,
      request: undefined,
      response: undefined,
      secureConnect: undefined,
      send: undefined,
      socket: undefined
    },
    prefixUrl: '',
    body: undefined,
    form: undefined,
    json: undefined,
    cookieJar: undefined,
    ignoreInvalidCookies: false,
    searchParams: undefined,
    dnsLookup: undefined,
    dnsCache: undefined,
    context: {},
    hooks: {
      init: [],
      beforeRequest: [],
      beforeError: [],
      beforeRedirect: [],
      beforeRetry: [],
      afterResponse: []
    },
    followRedirect: true,
    maxRedirects: 10,
    cache: undefined,
    throwHttpErrors: true,
    username: '',
    password: '',
    http2: false,
    allowGetBody: false,
    headers: {
      'user-agent': 'got (https://github.com/sindresorhus/got)',
      'private-token': '[secure]',
      accept: 'application/json',
      'accept-encoding': 'gzip, deflate, br'
    },
    methodRewriting: false,
    dnsLookupIpVersion: undefined,
    parseJson: [Function: parse],
    stringifyJson: [Function: stringify],
    retry: {
      limit: 2,
      methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ],
      statusCodes: [
        408, 413, 429, 500,
        502, 503, 504, 521,
        522, 524
      ],
      errorCodes: [
        'ETIMEDOUT',
        'ECONNRESET',
        'EADDRINUSE',
        'ECONNREFUSED',
        'EPIPE',
        'ENOTFOUND',
        'ENETUNREACH',
        'EAI_AGAIN'
      ],
      maxRetryAfter: undefined,
      calculateDelay: [Function: calculateDelay],
      backoffLimit: Infinity,
      noise: 100
    },
    localAddress: undefined,
    method: 'GET',
    createConnection: undefined,
    cacheOptions: {
      shared: undefined,
      cacheHeuristic: undefined,
      immutableMinTimeToLive: undefined,
      ignoreCargoCult: undefined
    },
    https: {
      alpnProtocols: undefined,
      rejectUnauthorized: undefined,
      checkServerIdentity: undefined,
      certificateAuthority: undefined,
      key: undefined,
      certificate: undefined,
      passphrase: undefined,
      pfx: undefined,
      ciphers: undefined,
      honorCipherOrder: undefined,
      minVersion: undefined,
      maxVersion: undefined,
      signatureAlgorithms: undefined,
      tlsSessionLifetime: undefined,
      dhparam: undefined,
      ecdhCurve: undefined,
      certificateRevocationLists: undefined
    },
    encoding: undefined,
    resolveBodyOnly: false,
    isStream: false,
    responseType: 'text',
    url: URL {
      href: 'https://onecode.polycom-labs.com/api/v4/projects/video-endpoints%2Ftools%2Felement-framework/repository/commits/196c9be44[3370](https://onecode.polycom-labs.com/video-endpoints/tools/element-framework/-/jobs/2916712#L3370)2c4195ab9ca776bc18d360243df/merge_requests',
      origin: 'https://onecode.polycom-labs.com',
      protocol: 'https:',
      username: '',
      password: '',
      host: 'onecode.polycom-labs.com',
      hostname: 'onecode.polycom-labs.com',
      port: '',
      pathname: '/api/v4/projects/video-endpoints%2Ftools%2Felement-framework/repository/commits/196c9be4433702c4195ab9ca776bc18d360243df/merge_requests',
      search: '',
      searchParams: URLSearchParams {},
      hash: ''
    },
    pagination: {
      transform: [Function: transform],
      paginate: [Function: paginate],
      filter: [Function: filter],
      shouldContinue: [Function: shouldContinue],
      countLimit: Infinity,
      backoff: 0,
      requestLimit: 10000,
      stackAllItems: false
    },
    setHost: true,
    maxHeaderSize: undefined,
    signal: undefined,
    enableUnixSockets: false
  }
}
[4:43:51 AM] [semantic-release] › ✘  Failed step "success" of plugin "@semantic-release/gitlab"
[4:43:51 AM] [semantic-release] › ✘  An error occurred while running semantic-release: HTTPError: Response code 502 (Bad Gateway)
    at Request.<anonymous> (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:629:26)
    at Request.emit (node:events:526:35)
    at Request._onResponseBase (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:726:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Request._onResponse (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:768:13) {
  input: undefined,
  code: 'ERR_NON_2XX_3XX_RESPONSE',
  timings: {
    start: 1690865029199,
    socket: 1690865029199,
    lookup: 1690865029451,
    connect: 1690865030272,
    secureConnect: 1690865031046,
    upload: 1690865031119,
    response: 1690865031193,
    end: 1690865031194,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 0,
      dns: 252,
      tcp: 821,
      tls: 774,
      request: 73,
      firstByte: 74,
      download: 1,
      total: 1995
    }
  },
  options: {
    request: undefined,
    agent: { http: undefined, https: undefined, http2: undefined },
    h2session: undefined,
    decompress: true,
    timeout: {
      connect: undefined,
      lookup: undefined,
      read: undefined,
      request: undefined,
      response: undefined,
      secureConnect: undefined,
      send: undefined,
      socket: undefined
    },
    prefixUrl: '',
    body: undefined,
    form: undefined,
    json: undefined,
    cookieJar: undefined,
    ignoreInvalidCookies: false,
    searchParams: undefined,
    dnsLookup: undefined,
    dnsCache: undefined,
    context: {},
    hooks: {
      init: [],
      beforeRequest: [],
      beforeError: [],
      beforeRedirect: [],
      beforeRetry: [],
      afterResponse: []
    },
    followRedirect: true,
    maxRedirects: 10,
    cache: undefined,
    throwHttpErrors: true,
    username: '',
    password: '',
    http2: false,
    allowGetBody: false,
    headers: {
      'user-agent': 'got (https://github.com/sindresorhus/got)',
      'private-token': '[secure]',
      accept: 'application/json',
      'accept-encoding': 'gzip, deflate, br'
    },
    methodRewriting: false,
    dnsLookupIpVersion: undefined,
    parseJson: [Function: parse],
    stringifyJson: [Function: stringify],
    retry: {
      limit: 2,
      methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ],
      statusCodes: [
        408, 413, 429, 500,
        502, 503, 504, 521,
        522, 524
      ],
      errorCodes: [
        'ETIMEDOUT',
        'ECONNRESET',
        'EADDRINUSE',
        'ECONNREFUSED',
        'EPIPE',
        'ENOTFOUND',
        'ENETUNREACH',
        'EAI_AGAIN'
      ],
      maxRetryAfter: undefined,
      calculateDelay: [Function: calculateDelay],
      backoffLimit: Infinity,
      noise: 100
    },
    localAddress: undefined,
    method: 'GET',
    createConnection: undefined,
    cacheOptions: {
      shared: undefined,
      cacheHeuristic: undefined,
      immutableMinTimeToLive: undefined,
      ignoreCargoCult: undefined
    },
    https: {
      alpnProtocols: undefined,
      rejectUnauthorized: undefined,
      checkServerIdentity: undefined,
      certificateAuthority: undefined,
      key: undefined,
      certificate: undefined,
      passphrase: undefined,
      pfx: undefined,
      ciphers: undefined,
      honorCipherOrder: undefined,
      minVersion: undefined,
      maxVersion: undefined,
      signatureAlgorithms: undefined,
      tlsSessionLifetime: undefined,
      dhparam: undefined,
      ecdhCurve: undefined,
      certificateRevocationLists: undefined
    },
    encoding: undefined,
    resolveBodyOnly: false,
    isStream: false,
    responseType: 'text',
    url: URL {
      href: 'https://onecode.polycom-labs.com/api/v4/projects/video-endpoints%2Ftools%2Felement-framework/repository/commits/196c9be4433702c4195ab9ca776bc18d360243df/merge_requests',
      origin: '[https://onecode.polycom-labs.com'](https://onecode.polycom-labs.com%27/),
      protocol: 'https:',
      username: '',
      password: '',
      host: 'onecode.polycom-labs.com',
      hostname: 'onecode.polycom-labs.com',
      port: '',
      pathname: '/api/v4/projects/video-endpoints%2Ftools%2Felement-framework/repository/commits/196c9be4433702c4195ab9ca776bc18d360243df/merge_requests',
      search: '',
      searchParams: URLSearchParams {},
      hash: ''
    },
    pagination: {
      transform: [Function: transform],
      paginate: [Function: paginate],
      filter: [Function: filter],
      shouldContinue: [Function: shouldContinue],
      countLimit: Infinity,
      backoff: 0,
      requestLimit: 10000,
      stackAllItems: false
    },
    setHost: true,
    maxHeaderSize: undefined,
    signal: undefined,
    enableUnixSockets: false
  },
  pluginName: '@semantic-release/gitlab'
}
AggregateError: 
    HTTPError: Response code 502 (Bad Gateway)
        at Request.<anonymous> (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise/index.js:86:42)
        at Request._onResponseBase (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:726:22)
        at async Request._onResponse (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:768:13)
    at file:///usr/lib/node_modules/semantic-release/lib/plugins/pipeline.js:55:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async pluginsConfigAccumulator.<computed> [as success] (file:///usr/lib/node_modules/semantic-release/lib/plugins/index.js:87:11)
    at async run (file:///usr/lib/node_modules/semantic-release/index.js:215:3)
    at async Module.default (file:///usr/lib/node_modules/semantic-release/index.js:275:22)
    at async default (file:///usr/lib/node_modules/semantic-release/cli.js:55:5) {
  errors: [
    HTTPError: Response code 502 (Bad Gateway)
        at Request.<anonymous> (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise/index.js:86:42)
        at Object.onceWrapper (node:events:629:26)
        at Request.emit (node:events:526:35)
        at Request._onResponseBase (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:726:22)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async Request._onResponse (file:///usr/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:768:13) {
      input: undefined,
      code: 'ERR_NON_2XX_3XX_RESPONSE',
      timings: [Object],
      options: {
        request: undefined,
        agent: { http: undefined, https: undefined, http2: undefined },
        h2session: undefined,
        decompress: true,
        timeout: {
          connect: undefined,
          lookup: undefined,
          read: undefined,
          request: undefined,
          response: undefined,
          secureConnect: undefined,
          send: undefined,
          socket: undefined
        },
        prefixUrl: '',
        body: undefined,
        form: undefined,
        json: undefined,
        cookieJar: undefined,
        ignoreInvalidCookies: false,
        searchParams: undefined,
        dnsLookup: undefined,
        dnsCache: undefined,
        context: {},
        hooks: {
          init: [],
          beforeRequest: [],
          beforeError: [],
          beforeRedirect: [],
          beforeRetry: [],
          afterResponse: []
        },
        followRedirect: true,
        maxRedirects: 10,
        cache: undefined,
        throwHttpErrors: true,
        username: '',
        password: '',
        http2: false,
        allowGetBody: false,
        headers: {
          'user-agent': 'got (https://github.com/sindresorhus/got)',
          'private-token': '[secure]',
          accept: 'application/json',
          'accept-encoding': 'gzip, deflate, br'
        },
        methodRewriting: false,
        dnsLookupIpVersion: undefined,
        parseJson: [Function: parse],
        stringifyJson: [Function: stringify],
        retry: {
          limit: 2,
          methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ],
          statusCodes: [
            408, 413, 429, 500,
            502, 503, 504, 521,
            522, 524
          ],
          errorCodes: [
            'ETIMEDOUT',
            'ECONNRESET',
            'EADDRINUSE',
            'ECONNREFUSED',
            'EPIPE',
            'ENOTFOUND',
            'ENETUNREACH',
            'EAI_AGAIN'
          ],
          maxRetryAfter: undefined,
          calculateDelay: [Function: calculateDelay],
          backoffLimit: Infinity,
          noise: 100
        },
        localAddress: undefined,
        method: 'GET',
        createConnection: undefined,
        cacheOptions: {
          shared: undefined,
          cacheHeuristic: undefined,
          immutableMinTimeToLive: undefined,
          ignoreCargoCult: undefined
        },
        https: {
          alpnProtocols: undefined,
          rejectUnauthorized: undefined,
          checkServerIdentity: undefined,
          certificateAuthority: undefined,
          key: undefined,
          certificate: undefined,
          passphrase: undefined,
          pfx: undefined,
          ciphers: undefined,
          honorCipherOrder: undefined,
          minVersion: undefined,
          maxVersion: undefined,
          signatureAlgorithms: undefined,
          tlsSessionLifetime: undefined,
          dhparam: undefined,
          ecdhCurve: undefined,
          certificateRevocationLists: undefined
        },
        encoding: undefined,
        resolveBodyOnly: false,
        isStream: false,
        responseType: 'text',
        url: URL {
          href: 'https://onecode.polycom-labs.com/api/v4/projects/video-endpoints%2Ftools%2Felement-framework/repository/commits/196c9be4433702c4195ab9ca776bc18d[3602](https://onecode.polycom-labs.com/video-endpoints/tools/element-framework/-/jobs/2916712#L3602)43df/merge_requests',
          origin: 'https://onecode.polycom-labs.com',
          protocol: 'https:',
          username: '',
          password: '',
          host: 'onecode.polycom-labs.com',
          hostname: 'onecode.polycom-labs.com',
          port: '',
          pathname: '/api/v4/projects/video-endpoints%2Ftools%2Felement-framework/repository/commits/196c9be4433702c4195ab9ca776bc18d360243df/merge_requests',
          search: '',
          searchParams: URLSearchParams {},
          hash: ''
        },
        pagination: {
          transform: [Function: transform],
          paginate: [Function: paginate],
          filter: [Function: filter],
          shouldContinue: [Function: shouldContinue],
          countLimit: Infinity,
          backoff: 0,
          requestLimit: 10000,
          stackAllItems: false
        },
        setHost: true,
        maxHeaderSize: undefined,
        signal: undefined,
        enableUnixSockets: false
      },
      pluginName: '@semantic-release/gitlab'
    }
  ]
}
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
@travi travi transferred this issue from semantic-release/semantic-release Aug 4, 2023
@fgreinacher
Copy link
Contributor

Something seems to be wrong with the origin of the request:

     origin: '[https://onecode.polycom-labs.com'](https://onecode.polycom-labs.com%27/),

@ta0chen Do you have a proxy configured on your system or something intercepting your traffic?

@thompson-shaun
Copy link
Contributor

thompson-shaun commented Sep 24, 2023

I think we're seeing something similar on gitlab.com but so far it only manifests in projects marked as a CI/CD Catalog. https://docs.gitlab.com/ee/ci/components/catalog.html

https://docs.gitlab.com/ee/architecture/blueprints/ci_pipeline_components/

[6:47:13 PM] [semantic-release] [@semantic-release/gitlab] › ✘  An error occurred while making a request to the GitLab release API:
HTTPError: Response code 500 (Internal Server Error)
    at Request.<anonymous> (file:///usr/local/share/.config/yarn/global/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:629:26)
    at Request.emit (node:events:526:35)
    at Request._onResponseBase (file:///usr/local/share/.config/yarn/global/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:726:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Request._onResponse (file:///usr/local/share/.config/yarn/global/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/core/index.js:768:13) {
  input: undefined,
  code: 'ERR_NON_2XX_3XX_RESPONSE',
  timings: {
    start: 1695581232782,
    socket: 1695581232783,
    lookup: 1695581232783,
    connect: 1695581232783,
    secureConnect: 1695581232783,
    upload: 1695581232783,
    response: 1695581233340,
    end: 1695581233341,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 1,
      dns: 0,
      tcp: 0,
      tls: 0,
      request: 0,
      firstByte: 557,
      download: 1,
      total: 559
    }
  },
  options: {
    request: undefined,
    agent: { http: undefined, https: undefined, http2: undefined },
    h2session: undefined,
    decompress: true,
    timeout: {
      connect: undefined,
      lookup: undefined,
      read: undefined,
      request: undefined,
      response: undefined,
      secureConnect: undefined,
      send: undefined,
      socket: undefined
    },
    prefixUrl: '',
    body: '{"tag_name":"v1.1.2","description":"## [1.1.2](https://gitlab.com/SomeGroup/ci-catalog/docker/compare/v1.1.1...v1.1.2) (2023-09-24)\\n\\n","assets":{"links":[]}}',
    form: undefined,
    json: undefined,
    cookieJar: undefined,
    ignoreInvalidCookies: false,
    searchParams: undefined,
    dnsLookup: undefined,
    dnsCache: undefined,
    context: {},
    hooks: {
      init: [],
      beforeRequest: [],
      beforeError: [],
      beforeRedirect: [],
      beforeRetry: [],
      afterResponse: []
    },
    followRedirect: true,
    maxRedirects: 10,
    cache: undefined,
    throwHttpErrors: true,
    username: '',
    password: '',
    http2: false,
    allowGetBody: false,
    headers: {
      'user-agent': 'got (https://github.com/sindresorhus/got)',
      'private-token': '[secure]',
      'content-type': 'application/json',
      'content-length': '163',
      'accept-encoding': 'gzip, deflate, br'
    },
    methodRewriting: false,
    dnsLookupIpVersion: undefined,
    parseJson: [Function: parse],
    stringifyJson: [Function: stringify],
    retry: {
      limit: 2,
      methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ],
      statusCodes: [
        408, 413, 429, 500,
        502, 503, 504, 521,
        522, 524
      ],
      errorCodes: [
        'ETIMEDOUT',
        'ECONNRESET',
        'EADDRINUSE',
        'ECONNREFUSED',
        'EPIPE',
        'ENOTFOUND',
        'ENETUNREACH',
        'EAI_AGAIN'
      ],
      maxRetryAfter: undefined,
      calculateDelay: [Function: calculateDelay],
      backoffLimit: Infinity,
      noise: 100
    },
    localAddress: undefined,
    method: 'POST',
    createConnection: undefined,
    cacheOptions: {
      shared: undefined,
      cacheHeuristic: undefined,
      immutableMinTimeToLive: undefined,
      ignoreCargoCult: undefined
    },
    https: {
      alpnProtocols: undefined,
      rejectUnauthorized: undefined,
      checkServerIdentity: undefined,
      certificateAuthority: undefined,
      key: undefined,
      certificate: undefined,
      passphrase: undefined,
      pfx: undefined,
      ciphers: undefined,
      honorCipherOrder: undefined,
      minVersion: undefined,
      maxVersion: undefined,
      signatureAlgorithms: undefined,
      tlsSessionLifetime: undefined,
      dhparam: undefined,
      ecdhCurve: undefined,
      certificateRevocationLists: undefined
    },
    encoding: undefined,
    resolveBodyOnly: false,
    isStream: false,
    responseType: 'text',
    url: URL {
      href: 'https://gitlab.com/api/v4/projects/SomeGroup%2Fci-catalog%2Fdocker/releases',
      origin: 'https://gitlab.com',
      protocol: 'https:',
      username: '',
      password: '',
      host: 'gitlab.com',
      hostname: 'gitlab.com',
      port: '',
      pathname: '/api/v4/projects/SomeGroup%2Fci-catalog%2Fdocker/releases',
      search: '',
      searchParams: URLSearchParams {},
      hash: ''
    },
    pagination: {
      transform: [Function: transform],
      paginate: [Function: paginate],
      filter: [Function: filter],
      shouldContinue: [Function: shouldContinue],
      countLimit: Infinity,
      backoff: 0,
      requestLimit: 10000,
      stackAllItems: false
    },
    setHost: true,
    maxHeaderSize: undefined,
    signal: undefined,
    enableUnixSockets: false
  }
}

@ta0chen
Copy link
Author

ta0chen commented Sep 25, 2023

Something seems to be wrong with the origin of the request:

     origin: '[https://onecode.polycom-labs.com'](https://onecode.polycom-labs.com%27/),

@ta0chen Do you have a proxy configured on your system or something intercepting your traffic?

Sorry @fgreinacher , since the security concern, IT team does not allow me to have the the proxy or network traffic interceptor.

@fgreinacher
Copy link
Contributor

fgreinacher commented Sep 29, 2023

Something seems to be wrong with the origin of the request:

     origin: '[https://onecode.polycom-labs.com'](https://onecode.polycom-labs.com%27/),

@ta0chen Do you have a proxy configured on your system or something intercepting your traffic?

Sorry @fgreinacher , since the security concern, IT team does not allow me to have the the proxy or network traffic interceptor.

@ta0chen I did not mean that you should intercept it on your own. The question is whether your IT team directs your traffic through a proxy server or something else that might modify the request.

@fgreinacher
Copy link
Contributor

I think we're seeing something similar on gitlab.com but so far it only manifests in projects marked as a CI/CD Catalog.

@autotmp Not sure, the request shows HTTP status 500 which is just a generic server issue. Where in the request do you see an additional quote?

@ta0chen
Copy link
Author

ta0chen commented Sep 29, 2023

Something seems to be wrong with the origin of the request:

     origin: '[https://onecode.polycom-labs.com'](https://onecode.polycom-labs.com%27/),

@ta0chen Do you have a proxy configured on your system or something intercepting your traffic?

Sorry @fgreinacher , since the security concern, IT team does not allow me to have the the proxy or network traffic interceptor.

@ta0chen I did not mean that you should intercept it on your own. The question is whether your IT team directs your traffic through a proxy server or something else that might modify the request.
They do not have the proxy server.

@thompson-shaun
Copy link
Contributor

I think we're seeing something similar on gitlab.com but so far it only manifests in projects marked as a CI/CD Catalog.

@autotmp Not sure, the request shows HTTP status 500 which is just a generic server issue. Where in the request do you see an additional quote?

You are correct - went a bit too far down he rabbit hole on this one. There is definitely an issues when trying to generate a release in a project marked as a CI Component Catalog project but it's not an extra quote. I'll investigate a bit more and open a new issues if there's something concrete to report on the semantic-release side. I suspect it's on the GitLab side.

@fgreinacher
Copy link
Contributor

@ta0chen I had a look at your log again and it looks like the requests are made towards the correct URL (url.href), it's only the origin that looks a little bit weird. This plugin does not fiddle around with the origin, so I don't really know how to help with this, sorry 🤷

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

No branches or pull requests

3 participants