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 in setup_git.sh when checking out a tag #400

Open
sbliven opened this issue Dec 16, 2024 · 1 comment · May be fixed by #401
Open

Error in setup_git.sh when checking out a tag #400

sbliven opened this issue Dec 16, 2024 · 1 comment · May be fixed by #401

Comments

@sbliven
Copy link
Contributor

sbliven commented Dec 16, 2024

I'm using the release-jobs branch (merged with master). The key flags set seem to be

(v4/compose.jobs.yaml)

    build:
      context:
        https://github.com/SciCatProject/scicat-backend-next.git#release-jobs
    environment:
      GITHUB_REPO:
        https://github.com/SciCatProject/scicat-backend-next.git#release-jobs

I have enabled DEV=true and DEV_BBACKUP=true in .env.

Building the images after removing volumes and the bbackup folder gives an error when creating the backend container:

error: The following untracked working tree files would be overwritten by checkout:
        .eslintrc.json
        jobConfig.example.yaml
        src/common/email-templates/job-template-simplified.html
        src/config/job-config/README.md
        src/config/job-config/actions/corejobactioncreators.module.ts
        src/config/job-config/actions/emailaction/emailaction.interface.ts
        src/config/job-config/actions/emailaction/emailaction.module.ts
        src/config/job-config/actions/emailaction/emailaction.service.ts
        src/config/job-config/actions/emailaction/emailaction.ts
        src/config/job-config/actions/logaction/logaction.interface.ts
        src/config/job-config/actions/logaction/logaction.module.ts
        src/config/job-config/actions/logaction/logaction.service.ts
        src/config/job-config/actions/logaction/logaction.ts
        src/config/job-config/actions/rabbitmqaction/rabbitmqaction.interface.ts
        src/config/job-config/actions/rabbitmqaction/rabbitmqaction.module.ts
        src/config/job-config/actions/rabbitmqaction/rabbitmqaction.service.ts
        src/config/job-config/actions/rabbitmqaction/rabbitmqaction.ts
        src/config/job-config/actions/urlaction/urlaction.interface.ts
        src/config/job-config/actions/urlaction/urlaction.module.ts
        src/config/job-config/actions/urlaction/urlaction.service.ts
        src/config/job-config/actions/urlaction/urlaction.ts
        src/config/job-config/actions/validateaction/validateaction.interface.ts
        src/config/job-config/actions/validateaction/validateaction.module.ts
        src/config/job-config/actions/validateaction/validateaction.service.ts
        src/config/job-config/actions/validateaction/validateaction.spec.ts
        src/config/job-config/actions/validateaction/validateaction.ts
        src/config/job-config/handlebar-utils.ts
        src/config/job-config/jobconfig.interface.ts
        src/config/job-config/jobconfig.module.ts
        src/config/job-config/jobconfig.schema.ts
        src/config/job-config/jobconfig.service.ts
        src/config/job-config/jobconfig.spec.ts
        src/jobs/dto/status-update-job.dto.ts
        src/jobs/interfaces/job-filters.interface.ts
        src/jobs/types/job-types.enum.ts
        src/jobs/types/jobs-auth.enum.ts
        src/jobs/types/jobs-config-schema.enum.ts
        test/config/jobconfig.yaml
Please move or remove them before you switch branches.

Basically, the setup_git.sh script is failing because the image gets created in the context of the requested branch, but then we run git reset --hard origin/"${DEFAULT_BRANCH}" which leaves all the files that were added on the branch. Then we try to checkout the requested branch again and every file causes a conflict.

What's the point of the reset command? Can we just skip that?

@minottic minottic linked a pull request Dec 17, 2024 that will close this issue
@minottic
Copy link
Contributor

The reset is needed because git init only adds the .git folder but does not track files (so they would all appear new).

The image build pulls files from release-jobs branch. The git reset master uncommits some of these files as they are not in master, and the git checkout release-jobs, which would add these files again, fails because it would override them. Resetting to the branch directly should solve this issue, see #401

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

Successfully merging a pull request may close this issue.

2 participants