ProjectHook Resource Shows Replace Plan On Upstream Version V17.9.0

by ADMIN 68 views

Describe What Happened

When running an upgrade test to v17.9.0 of the upstream provider, a replacement plan is generated for the ProjectHook resource. This unexpected behavior is observed when using the Pulumi GitLab provider.

Sample Program

The sample program that demonstrates this issue can be found in the Pulumi GitLab repository. The relevant code snippet is as follows:

// Pulumi.yaml
name: index_projecthook
runtime: yaml
description: A brief description of your project.

// Pulumi.yaml (continued)
onPrepare: |
  pulumi config set gitlab:token $GITLAB_TOKEN
  pulumi config set gitlab:project $GITLAB_PROJECT

// Pulumi.yaml (continued)
resources:
  # ... other resources ...
  my_gitlab_projecthook:
    type: gitlab:index/projectHook:ProjectHook
    properties:
      confidentialIssuesEvents: true
      confidentialNoteEvents: false
      customWebhookTemplate: 'https://example.com/webhook-template'
      deploymentEvents: false
      description: 'My GitLab project hook'
      enableSslVerification: true
      hookId: '123456'
      id: '78910112'
      issuesEvents: true
      jobEvents: true
      mergeRequestsEvents: true
      name: 'webhook-receiver'
      noteEvents: true
      pipelineEvents: true
      project: '123456'
      pushEvents: true
      pushEventsBranchFilter: 'main'
      releasesEvents: false
      resourceAccessTokenEvents: false
      tagPushEvents: true
      token: 'secret'
      url: 'https://webhook.receiver.endpoint/hooks/gitlab'
      wikiPageEvents: true

Log Output

The log output for this issue is as follows:

pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:test::index_projecthookaMXmFQCHn5dj::pulumi:pulumi:Stack::index_projecthookaMXmFQCHn5dj-test]
    +-gitlab:index/projectHook:ProjectHook: (replace)
        [id=123456:78910112]
        [urn=urn:pulumi:test::index_projecthookaMXmFQCHn5dj::gitlab:index/projectHook:ProjectHook::my_gitlab_projecthook]
        confidentialIssuesEvents : true
        confidentialNoteEvents   : false
      + customWebhookTemplate    : output<string>
        deploymentEvents         : false
      + description              : output<string>
        enableSslVerification    : true
      ~ hookId                   : 123456 => output<string>
      ~ id                       : "78910112:123456" => output<string>
        issuesEvents             : true
        jobEvents                : true
        mergeRequestsEvents      : true
        name                     : "webhook-receiver"
        noteEvents               : true
        pipelineEvents           : true
        project                  : "123456"
      ~ projectId                : 123456 => output<string>
        pushEvents               : true
      + pushEventsBranchFilter   : output<string>
        releasesEvents           : false
      + resourceAccessTokenEvents: false
        tagPushEvents            : true
        token                    : [secret]
        url                      : "https://webhook.receiver.endpoint/hooks/gitlab"
        wikiPageEvents           : true
Resources:
    +-1 to replace
    2 unchanged

Affected Resource(s)

The ProjectHook resource is affected by this issue.

Output of pulumi about

The output of pulumi about is as follows:

CLI          
Version      3.153.1
Go Version   go1.23.6
Go Compiler  gc

Plugins
KIND      NAME    VERSION
resource  gitlab  unknown
language  yaml    1.13.1

Host     
OS       darwin
Version  15.3.1
Arch     arm64

This project is written in yaml

Current Stack: pulumi/index_projecthookaMXmFQCHn5dj/test

TYPE                                  URN
pulumi:pulumi:Stack                   urn:pulumi:test::index_projecthookaMXmFQCHn5dj::pulumi:pulumi:Stack::index_projecthookaMXmFQCHn5dj-test
pulumi:providers:gitlab               urn:pulumi:test::index_projecthookaMXmFQCHn5dj::pulumi:providers:gitlab::default
gitlab:index/project:Project          urn:pulumi:test::index_projecthookaMXmFQCHn5dj::gitlab:index/project:Project::my_gitlab_project
gitlab:index/projectHook:ProjectHook  urn:pulumi:test::index_projecthookaMXmFQCHn5dj::gitlab:index/projectHook:ProjectHook::my_gitlab_projecthook


Found no pending operations associated with pulumi/test

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/chall-pulumi-corp
User           chall-pulumi-corp
Organizations  chall-pulumi-corp, pulumi
Token type     personal

Dependencies:
NAME    VERSION
gitlab  

Pulumi locates its logs in /var/folders/3b/6mr1jkqx7r797ff75k27jfjc0000gn/T/ by default

Additional Context

If you run with --refresh the replace plan goes away and the plan shows no diff.

Contributing

Q: What is the issue with the ProjectHook resource?

A: The issue is that when upgrading to v17.9.0 of the upstream provider, a replacement plan is generated for the ProjectHook resource. This unexpected behavior is observed when using the Pulumi GitLab provider.

Q: What is the expected behavior?

A: The expected behavior is that the ProjectHook resource should not show a replace plan when upgrading to v17.9.0 of the upstream provider.

Q: What is the sample program that demonstrates this issue?

A: The sample program that demonstrates this issue can be found in the Pulumi GitLab repository. The relevant code snippet is as follows:

// Pulumi.yaml
name: index_projecthook
runtime: yaml
description: A brief description of your project.

// Pulumi.yaml (continued)
onPrepare: |
  pulumi config set gitlab:token $GITLAB_TOKEN
  pulumi config set gitlab:project $GITLAB_PROJECT

// Pulumi.yaml (continued)
resources:
  # ... other resources ...
  my_gitlab_projecthook:
    type: gitlab:index/projectHook:ProjectHook
    properties:
      confidentialIssuesEvents: true
      confidentialNoteEvents: false
      customWebhookTemplate: 'https://example.com/webhook-template'
      deploymentEvents: false
      description: 'My GitLab project hook'
      enableSslVerification: true
      hookId: '123456'
      id: '78910112'
      issuesEvents: true
      jobEvents: true
      mergeRequestsEvents: true
      name: 'webhook-receiver'
      noteEvents: true
      pipelineEvents: true
      project: '123456'
      pushEvents: true
      pushEventsBranchFilter: 'main'
      releasesEvents: false
      resourceAccessTokenEvents: false
      tagPushEvents: true
      token: 'secret'
      url: 'https://webhook.receiver.endpoint/hooks/gitlab'
      wikiPageEvents: true

Q: What is the log output for this issue?

A: The log output for this issue is as follows:

pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:test::index_projecthookaMXmFQCHn5dj::pulumi:pulumi:Stack::index_projecthookaMXmFQCHn5dj-test]
    +-gitlab:index/projectHook:ProjectHook: (replace)
        [id=123456:78910112]
        [urn=urn:pulumi:test::index_projecthookaMXmFQCHn5dj::gitlab:index/projectHook:ProjectHook::my_gitlab_projecthook]
        confidentialIssuesEvents : true
        confidentialNoteEvents   : false
      + customWebhookTemplate    : output<string>
        deploymentEvents         : false
      + description              : output<string>
        enableSslVerification    : true
      ~ hookId                   : 123456 => output<string>
      ~ id                       : "78910112:123456" => output<string>
        issuesEvents             : true
        jobEvents                : true
        mergeRequestsEvents      : true
        name                     : "webhook-receiver"
        noteEvents               : true
        pipelineEvents           : true
        project                  : "123456"
      ~ projectId                : 123456 => output<string>
        pushEvents               : true
      + pushEventsBranchFilter   : output<string>
        releasesEvents           : false
      + resourceAccessTokenEvents: false
        tagPushEvents            : true
        token                    : [secret]
        url                      : "https://webhook.receiver.endpoint/hooks/gitlab"
        wikiPageEvents           : true
Resources:
    +-1 to replace
    2 unchanged

Q: What is the output of pulumi about?

A: The output of pulumi about is as follows:

CLI          
Version      3.153.1
Go Version   go1.23.6
Go Compiler  gc

Plugins
KIND      NAME    VERSION
resource  gitlab  unknown
language  yaml    1.13.1

Host     
OS       darwin
Version  15.3.1
Arch     arm64

This project is written in yaml

Current Stack: pulumi/index_projecthookaMXmFQCHn5dj/test

TYPE                                  URN
pulumi:pulumi:Stack                   urn:pulumi:test::index_projecthookaMXmFQCHn5dj::pulumi:pulumi:Stack::index_projecthookaMXmFQCHn5dj-test
pulumi:providers:gitlab               urn:pulumi:test::index_projecthookaMXmFQCHn5dj::pulumi:providers:gitlab::default
gitlab:index/project:Project          urn:pulumi:test::index_projecthookaMXmFQCHn5dj::gitlab:index/project:Project::my_gitlab_project
gitlab:index/projectHook:ProjectHook  urn:pulumi:test::index_projecthookaMXmFQCHn5dj::gitlab:index/projectHook:ProjectHook::my_gitlab_projecthook


Found no pending operations associated with pulumi/test

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/chall-pulumi-corp
User           chall-pulumi-corp
Organizations  chall-pulumi-corp, pulumi
Token type     personal

Dependencies:
NAME    VERSION
gitlab  

Pulumi locates its logs in /var/folders/3b/6mr1jkqx7r797ff75k27jfjc0000gn/T/ by default

Q: How can I contribute a fix for this issue?

A: To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).