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

Error after migrating from Github repository to Gitlab #603

Open
leoniralves opened this issue Jan 15, 2024 · 9 comments
Open

Error after migrating from Github repository to Gitlab #603

leoniralves opened this issue Jan 15, 2024 · 9 comments

Comments

@leoniralves
Copy link

I'm trying to migrate danger-swift from Github to Gitlab on a self-hosted server, but it's failing. I followed this tutorial for configure env vars.

I'm using the SPM for install Danger Swift and dependencies.

My Package.swift:

let package = Package(
    name: "Project",
    products: [
        .library(
            name: "DangerDeps",
            type: .dynamic,
            targets: ["DangerDependencies"]),
    ],
    dependencies: [
        .package(
            url: "https://github.com/danger/swift.git",
            from: "3.18.0"),
        .package(
            url: "https://github.com/f-meloni/danger-swift-coverage.git",
            from: "1.2.1"),
        .package(
            url: "https://github.com/f-meloni/danger-swift-xcodesummary",
            from: "1.2.1"),
    ],
    targets: [
        .target(
            name: "DangerDependencies",
            dependencies: [
                .product(name: "Danger", package: "swift"),
                .product(name: "DangerSwiftCoverage", package: "danger-swift-coverage"),
                .product(name: "DangerXCodeSummary", package: "danger-swift-xcodesummary")
            ],
            path: "DangerDeps"),
    ]
)

My run script:

#!/bin/sh

# Install Brew dependencies
brew bundle

# Swift Package Manager
swift build --target DangerDependencies

# Run Danger-Swift
swift build danger-swift ci --verbose

The error from Bitrise

------------------------------
--- Step: ./.run_danger.sh ---
------------------------------
$ ./.run_danger.sh
▸ Using danger/tap/danger-swift
▸ Using lizard-analyzer
▸ Using swiftlint
▸ Using sonar-scanner
▸ Homebrew Bundle complete! 4 Brewfile dependencies now installed.
▸ Error:  HTTPError: Response code 404 (Not Found)
▸ at Request.<anonymous> (/snapshot/danger-js/node_modules/got/dist/source/as-promise/index.js:118:42)
▸ at processTicksAndRejections (node:internal/process/task_queues:96:5) {
▸ code: 'ERR_NON_2XX_3XX_RESPONSE',
▸ timings: {
▸ start: 1705342648287,
▸ socket: 1705342648289,
▸ lookup: 1705342648302,
▸ connect: 1705342648371,
▸ secureConnect: 1705342648549,
▸ upload: 1705342648550,
▸ response: 1705342648655,
▸ end: 1705342648655,
▸ error: undefined,
▸ abort: undefined,
▸ phases: {
▸ wait: 2,
▸ dns: 13,
▸ tcp: 69,
▸ tls: 178,
▸ request: 1,
▸ firstByte: 105,
▸ download: 0,
▸ total: 368
▸ }
▸ },
▸ description: undefined
▸ }
▸ Launching Danger Swift ci (v3.18.0)
▸ Finding out where the danger executable is
▸ Running: /opt/homebrew/bin/danger ci --process danger-swift --passURLForDSL --verbose

Can someone help me? 😉

@f-meloni
Copy link
Member

It seems it is not finding danger-js

▸ Error:  HTTPError: Response code 404 (Not Found)
▸ at Request.<anonymous> (/snapshot/danger-js/node_modules/got/dist/source/as-promise/index.js:118:42)
▸ at processTicksAndRejections (node:internal/process/task_queues:96:5) {

Have you tried to install it manually with brew?

@leoniralves
Copy link
Author

It seems it is not finding danger-js

▸ Error:  HTTPError: Response code 404 (Not Found)
▸ at Request.<anonymous> (/snapshot/danger-js/node_modules/got/dist/source/as-promise/index.js:118:42)
▸ at processTicksAndRejections (node:internal/process/task_queues:96:5) {

Have you tried to install it manually with brew?

@f-meloni Yes, I tried installing from brew without SPM. The error is the same.

@leoniralves
Copy link
Author

@f-meloni When I tried the danger-gitlab (without DangerSwift) with Ruby's Dangerfile, everything worked.

@f-meloni
Copy link
Member

Danger Ruby doesn't use danger-js.
Have you tried to install danger-js with brew, before using/installing Danger-Swift?

@leoniralves
Copy link
Author

@f-meloni I hadn't tried it yet. I tried now.

  • My Brewfile
# 'brew install'
brew "danger/tap/danger-js"
brew "danger/tap/danger-swift"
  • Output Bitrise
▸ Using danger/tap/danger-js
▸ Using danger/tap/danger-swift
▸ Homebrew Bundle complete! 2 Brewfile dependencies now installed.
▸ Error:  HTTPError: Response code 404 (Not Found)
▸ at Request.<anonymous> (/snapshot/danger-js/node_modules/got/dist/source/as-promise/index.js:118:42)
▸ at processTicksAndRejections (node:internal/process/task_queues:96:5) {
▸ code: 'ERR_NON_2XX_3XX_RESPONSE',
▸ timings: {
▸ start: 1705412663480,
▸ socket: 1705412663483,
▸ lookup: 1705412663492,
▸ connect: 1705412663505,
▸ secureConnect: 1705412663534,
▸ upload: 1705412663534,
▸ response: 1705412663584,
▸ end: 1705412663585,
▸ error: undefined,
▸ abort: undefined,
▸ phases: {
▸ wait: 3,
▸ dns: 9,
▸ tcp: 13,
▸ tls: 29,
▸ request: 0,
▸ firstByte: 50,
▸ download: 1,
▸ total: 105
▸ }
▸ },
▸ description: undefined
▸ }
▸ Launching Danger Swift ci (v3.18.0)
▸ Finding out where the danger executable is
▸ Running: /opt/homebrew/bin/danger ci --process danger-swift --passURLForDSL --verbose
▸ keyNotFound(CodingKeys(stringValue: "tagName", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"tagName\", intValue: nil) (\"tagName\"), converted to tag_name.", underlyingError: nil))

@f-meloni
Copy link
Member

It seems that the issue is actually on danger-js, the request to install it is failing.
Not much I can suggest in this case, but if you are using Danger Swift with SPM you can use npm to install danger-js, that might fix the issue.

@leoniralves
Copy link
Author

@f-meloni I don't understand why this Bitrise pipeline was working from Github and now not from Gitlab. 🤔

@leoniralves
Copy link
Author

It seems that the issue is actually on danger-js, the request to install it is failing.
Not much I can suggest in this case, but if you are using Danger Swift with SPM you can use npm to install danger-js, that might fix the issue.

@f-meloni It really seems like danger-js is not installing correctly.

Skipping install of danger-js formula. It is already installed.

Run brew command
Brew prefix: /opt/homebrew
Active arch: arm64
$ brew "bundle" "-v"
/opt/homebrew/bin/brew tap homebrew/bundle
==> Tapping homebrew/bundle
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-bundle'...
Tapped 1 command (107 files, 2.2MB).
Skipping install of danger-js formula. It is already installed.
Using danger/tap/danger-js
Upgrading danger/tap/danger-swift
Upgrading danger-swift formula. It is installed but not up-to-date.
==> Upgrading 1 outdated package:
danger/tap/danger-swift 3.16.0 -> 3.18.0
==> Fetching danger/tap/danger-swift
==> Downloading https://github.com/danger/danger-swift/archive/3.18.0.tar.gz
==> Downloading from https://codeload.github.com/danger/swift/tar.gz/refs/tags/3.18.0
==> Upgrading danger/tap/danger-swift
  3.16.0 -> 3.18.0 

@leoniralves
Copy link
Author

It seems that the issue is actually on danger-js, the request to install it is failing.
Not much I can suggest in this case, but if you are using Danger Swift with SPM you can use npm to install danger-js, that might fix the issue.

About installing danger-js from npm. I already tried, but it didn't work. 😞

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

2 participants