Race condition with builds_access_level and gitlab_project_variable

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

As a developer, I want to be able to set builds_access_level to enabled for a gitlab_project resource and update gitlab_project_variable resources which depend on that project in the same Merge Request.

Right now, if a gitlab_project resource is being modified to change builds_access_level to enabled in the same changeset where gitlab_project_variable resources which depend on that project are being added, the plan will succeed but apply will fail a first run with a 403 forbidden on the project variables and only succeed after a 2nd run where the builds_access_level apply has finished.

I would assume this may also affect other settings like ci_config_path that may depend on CI/CD being enabled in general before being set.

Edited by 🤖 GitLab Bot 🤖