harness / gitness

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.
https://gitness.com
Apache License 2.0
31.96k stars 2.79k forks source link

[BUG] Unable to import repository from GitHub when branch name is not 'main' #3474

Closed KevinYouu closed 2 months ago

KevinYouu commented 5 months ago

I encountered an issue where importing a repository from GitHub fails when the branch name is not 'main'. The import process consistently displays Import in progress.... Additionally, when I commit locally with a branch name other than 'main', the committed code appears empty after submission.

截屏2024-02-11 22 22 36
flowck commented 5 months ago

I tried it out of curiosity and I was able to successfully import a repository.

Repo imported: https://github.com/beego/beego

docker run -d \
  -p 3000:3000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /tmp/gitness:/data \
  --name gitness \
  --restart always \
  harness/gitness

Screenshot 2024-02-14 at 20 04 59

KevinYouu commented 5 months ago

I tried it out of curiosity and I was able to successfully import a repository.

Repo imported: https://github.com/beego/beego

docker run -d \
  -p 3000:3000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /tmp/gitness:/data \
  --name gitness \
  --restart always \
  harness/gitness

Screenshot 2024-02-14 at 20 04 59

I'm deploying using docker-compose on Debian 12 operating system. Below is the configuration file. I'm encountering issues importing GitHub repositories.

version: '3'
services:
  gitness:
    container_name: gitness
    image: harness/gitness
    network_mode: host
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ~/gitness:/data
    restart: unless-stopped
image
abolast commented 4 months ago
services:
  gitness:
    image: harness/gitness
    container_name: gitness
    ports:
      - "3009:3000"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /home/abola/Documents/docker-compose-gitanyway/data:/data
    restart: always
    networks:
      gitea2:
        ipv4_address: 172.22.0.6

unable to import repository too. i tried from gogs and gitea.

zzinx58 commented 4 months ago

The same, Bad experience, sad..

zzinx58 commented 4 months ago

This issue could cause by using proxy i guess this is the point. After set Organization Name as my github username:zzinx58, Repository name: [projectName].git I am able to come to the next step.

hitesharinga commented 2 months ago

Hey @KevinYouu, Thanks for reporting the issue. I tried to import the repo you mentioned and was able to import it successfully. On the second issue - We have added support to update the default branch in the first commit if the first commit is not in the default branch.

Please reopen if you face the issue.