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

feat: Support process scoped variables #593

Merged
merged 17 commits into from
Jan 11, 2024

Conversation

tleed5
Copy link
Collaborator

@tleed5 tleed5 commented Jan 9, 2024

[SC-66829]
Based on #562

Result

Example

resource "octopusdeploy_variable" "test_variable" {
  owner_id  = "Projects-21"
  type      = "String"
  name      = "Test Process Scope"
  value     = "Scopey"
  scope {
    processes = ["Runbooks-1"]
  }
}

fixes #361

Copy link
Contributor

@zentron zentron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable. If we can add (or update an existing) test to include the usage of this parameter would be nice.

@tleed5 tleed5 requested a review from zentron January 11, 2024 00:10
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tenant scoped variables are already been tested here so it didn't seem necessary to test them again

Comment on lines 3373 to 3375
if len(variableSet.Variables) != 7 {
t.Fatalf("Expected 7 variables to be created")
}
Copy link
Collaborator Author

@tleed5 tleed5 Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figure we can just assert that the correct amount of variables are created, anything else would be covered by the fact the variable resources are created correctly.

Copy link
Contributor

@zentron zentron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from maybe a quick tweak to the test to validate that the scope exists as expected, even just explicitly checking some known value for each differently scoped variable then feel free to merge.
🙇 Thanks for pushing this one forward

@tleed5 tleed5 merged commit 1b34c24 into main Jan 11, 2024
21 checks passed
@tleed5 tleed5 deleted the tl/support-process-scoped-variables branch January 11, 2024 01:37
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 this pull request may close these issues.

Scope Variable to Runbook process
2 participants