-
Notifications
You must be signed in to change notification settings - Fork 272
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
[Bug - Fix] azuredevops_build_definition
- skip_first_run
to work for all repo types
#928
Conversation
@microsoft-github-policy-service agree |
@arkoc I think we could keep branch checks (pre-checks) of the Azure DevOps Git repo to ensure the pipeline can be triggered successfully. For other repository types we can ignore this check. |
If the build definition was succesffully created, can't we safely trigger the same build definition with the same branch name? |
@arkoc if the repository not initialized and there is not branch exist, pipeline run will not be triggered even with |
Can you create a build definition without initializing repository / branch? I bealive the valid git connection to the repo/branch is required for creating the build definition (pipeline). Am I missing something? |
@arkoc It is possible to such a build definition: resource "azuredevops_project" "example" {
name = "Example Project"
visibility = "private"
version_control = "Git"
work_item_template = "Agile"
}
resource "azuredevops_git_repository" "example" {
project_id = azuredevops_project.example.id
name = "Example Empty Git Repository"
initialization {
init_type = "Uninitialized"
}
}
resource "azuredevops_build_definition" "example" {
project_id = azuredevops_project.example.id
name = "Example Build Definition"
path = "\\ExampleFolder"
ci_trigger {
use_yaml = false
}
repository {
repo_type = "TfsGit"
repo_id = azuredevops_git_repository.example.id
branch_name = azuredevops_git_repository.example.default_branch
yml_path = "azure-pipelines.yml"
}
schedules {
branch_filter {
include = ["main"]
exclude = ["test", "regression"]
}
days_to_build = ["Wed", "Sun"]
schedule_only_with_changes = true
start_hours = 10
start_minutes = 59
time_zone = "(UTC) Coordinated Universal Time"
}
features {
skip_first_run = true
}
} |
Even if you add checks for repo and branch, run for this pipeline is going to still fail. The mentioned checks are not going to prevent it. |
An error/hit message should pop up to the user indicating that the running pipeline will not be triggered. |
This problem is not that repo or branch doesn't exists, the problem is that this pipleine doesn't have any .yaml with it. So it will not be tirggered. Right now the integration is fully broken for non tfs repos. It's not working for anyone. This suggested fix, can make it work for everyone, except cases where build pipleine doesnt have any instructions with it (is empty so nothing to trigger). How you suggest to continue? I suggest that, we can alwas trigger the pipele at that stage, if that errors out, we should just show "warning or hint" that run didn't work, beacause ultimately the resource was created. |
@arkoc Sounds reasonable. Can you add the |
Added. I am first time using Go, as well as implementing anything in Terraform Plugins. Is the |
|
@arkoc LGTM |
azuredevops_build_definition
- skip_first_run
to work for all repo types
All Submissions:
What about the current behavior has changed?
Issue Number: #862
The code is using
clients.GitReposClient
which I bealive is working only with DevOps Git Repos.When I pass repoId in GitHub format (gitOrg/repoName), it's throwing error "Page not found".
As far as I can see from the code, we need the branch information for passing
commitId
toversion
property in RunPipeline request. After few tests in DevOps UI and with Rest API directly, it looks likeversion
is not required. So we can ommit that which will allow to remove the code withGitReposClient
which was causing the code to work with only Azure DevOps Repos.Does this introduce a change to
go.mod
,go.sum
orvendor/
?Does this introduce a breaking change?
Any relevant logs, error output, etc?
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
Other information