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

Add support for importing Pipeline Schedules and Triggers #618

Merged

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented May 11, 2021

make testacc-up
docker-compose up -d gitlab-ce
Creating network "terraform-provider-gitlab_default" with the default driver
Creating volume "terraform-provider-gitlab_config-ce" with default driver
Creating volume "terraform-provider-gitlab_logs-ce" with default driver
Creating volume "terraform-provider-gitlab_data-ce" with default driver
Creating volume "terraform-provider-gitlab_config-ee" with default driver
Creating volume "terraform-provider-gitlab_logs-ee" with default driver
Creating volume "terraform-provider-gitlab_data-ee" with default driver
Pulling gitlab-ce (gitlab/gitlab-ce:)...
latest: Pulling from gitlab/gitlab-ce
345e3491a907: Pull complete
57671312ef6f: Pull complete
5e9250ddb7d0: Pull complete
6e6d4ab7149b: Pull complete
0368f51f232f: Pull complete
12163d3ee437: Pull complete
fd3aa074aa24: Pull complete
8c65b4a49951: Pull complete
a5e82faf9eb6: Pull complete
Digest: sha256:3421d0b39f305bacf63176bf73760fe1352f352472c6f02e7a6b4b19365d73d6
Status: Downloaded newer image for gitlab/gitlab-ce:latest
Creating terraform-provider-gitlab_gitlab-ce_1 ... done
./scripts/await-healthy.sh
Waiting for GitLab container to become healthy..................................................
GitLab is healthy
{"version":"13.11.3","revision":"b321336e443"}
make testacc RUN=TestAccGitlabPipeline
==> Checking that code complies with gofmt requirements...
TF_ACC=1 GITLAB_TOKEN=ACCTEST GITLAB_BASE_URL=http://127.0.0.1:8080/api/v4 go test -v ./gitlab -test.run TestAccGitlabPipeline -timeout 40m
=== RUN   TestAccGitlabPipelineSchedule_basic
--- PASS: TestAccGitlabPipelineSchedule_basic (16.23s)
=== RUN   TestAccGitlabPipelineSchedule_import
--- PASS: TestAccGitlabPipelineSchedule_import (8.54s)
=== RUN   TestAccGitlabPipelineScheduleVariable_basic
--- PASS: TestAccGitlabPipelineScheduleVariable_basic (8.88s)
=== RUN   TestAccGitlabPipelineTrigger_basic
--- PASS: TestAccGitlabPipelineTrigger_basic (7.60s)
=== RUN   TestAccGitlabPipelineTrigger_import
--- PASS: TestAccGitlabPipelineTrigger_import (7.22s)
PASS
ok      github.com/gitlabhq/terraform-provider-gitlab/gitlab    48.736s

@roidelapluie
Copy link
Collaborator

I am bit puzzled, it seems like the project id should somehow be in the pipeline schedule ID & triggers too. Not to be fixed in this pull request however.

@pdecat
Copy link
Contributor Author

pdecat commented Jun 8, 2021

I am bit puzzled, it seems like the project id should somehow be in the pipeline schedule ID & triggers too. Not to be fixed in this pull request however.

That's exactly what I thought, this would have allowed to use the pass-through importer.

@roidelapluie
Copy link
Collaborator

I am bit puzzled, it seems like the project id should somehow be in the pipeline schedule ID & triggers too. Not to be fixed in this pull request however.

That's exactly what I thought, this would have allowed to use the pass-through importer.

It is more than that. It is not guaranteed that pipelines ID will stay unique in the future, even if they are now.

@roidelapluie roidelapluie merged commit c8fcfe0 into gitlabhq:master Jun 8, 2021
@roidelapluie
Copy link
Collaborator

Thanks!

@pdecat pdecat deleted the support_pipeline_schedule_import branch June 8, 2021 13:19
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants