Skip to content

feat(workflows): Onboarding STACKIT Workflows#1528

Open
c-thiel wants to merge 1 commit into
stackitcloud:mainfrom
c-thiel:feat/workflows-onboarding
Open

feat(workflows): Onboarding STACKIT Workflows#1528
c-thiel wants to merge 1 commit into
stackitcloud:mainfrom
c-thiel:feat/workflows-onboarding

Conversation

@c-thiel

@c-thiel c-thiel commented Jun 19, 2026

Copy link
Copy Markdown

Adds Terraform support for STACKIT Workflows (Apache Airflow 3 as a service):

  resources:    stackit_workflows_instance, stackit_workflows_dag_bundle
  data sources: stackit_workflows_instance, stackit_workflows_instances,
                stackit_workflows_dag_bundle, stackit_workflows_dag_bundles,
                stackit_workflows_provider_options

All seven surfaces are gated behind the workflows experiment flag.

Notes for reviewers:

  • The workflows Go SDK is not yet on a published tag; this PR uses a replace-directive in go.mod pointing at the bot-generated branch. This is per the dev-tools team's request to enable an early review pass. The replace will be dropped once the SDK release lands.
  • dag_bundle list/get endpoints currently return 403 in prod for service-account-authenticated callers. The server-side fix is merged upstream and awaiting deploy; acceptance tests against those endpoints will only pass once that ships.
  • The Workflows team recently split DAG bundles out of the instance Create payload into a separate /dag-bundles resource. Two follow-up items are still in flight and are not provider bugs:
    • The new /dag-bundles list/get endpoints currently return 403 for
      service-account callers in production. The fix is merged upstream
      and awaiting deploy; acceptance tests against those endpoints will
      pass once it ships.
    • The instance helm chart still unconditionally provisions an
      ExternalSecret for the DAG-bundle git credentials, which means an
      Airflow 3 instance created without a bundle can't reach active.
      The team is working on this; in the meantime a follow-up provider
      PR will inline the bundles back onto the instance Create payload
      (which the API already supports) to side-step it.

Description

relates to #1234

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

Adds Terraform support for STACKIT Workflows (Apache Airflow 3 as a
service):

  resources:    stackit_workflows_instance, stackit_workflows_dag_bundle
  data sources: stackit_workflows_instance, stackit_workflows_instances,
                stackit_workflows_dag_bundle, stackit_workflows_dag_bundles,
                stackit_workflows_provider_options

All seven surfaces are gated behind the `workflows` experiment flag.

Notes for reviewers:

* The workflows Go SDK is not yet on a published tag; this PR uses a
  replace-directive in `go.mod` pointing at the bot-generated branch.
  This is per the dev-tools team's request to enable an early review
  pass. The replace will be dropped once the SDK release lands.
* `dag_bundle` list/get endpoints currently return 403 in prod for
  service-account-authenticated callers. The server-side fix is merged
  upstream and awaiting deploy; acceptance tests against those endpoints
  will only pass once that ships.
* A separate cluster-side issue (helm chart unconditionally provisions
  an ExternalSecret for the git-bundle credentials) means Airflow 3
  instances cannot reach `active` unless a dag_bundle is configured at
  Create time. This is owned by the API team. Subsequent provider PR
  will inline dag_bundles onto the instance Create payload to work
  around it cleanly.
@c-thiel c-thiel requested a review from a team as a code owner June 19, 2026 09:07
@github-actions

Copy link
Copy Markdown

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@github-actions github-actions Bot added the Stale PR is marked as stale due to inactivity. label Jun 30, 2026
@Fyusel Fyusel removed the Stale PR is marked as stale due to inactivity. label Jul 7, 2026
"region": schema.StringAttribute{Description: schemaDescriptions["region"], Optional: true, Computed: true},
"instance_id": schema.StringAttribute{
Description: schemaDescriptions["instance_id"],
Required: true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please sort: required - optional here please

return
}
d.client = apiClient
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tflog.Info() message missing here (... client configured...)

return
}
resp.Diagnostics.Append(resp.State.Set(ctx, model)...)
tflog.Debug(ctx, "Workflows DAG bundle read")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
tflog.Debug(ctx, "Workflows DAG bundle read")
tflog.Info(ctx, "Workflows DAG bundle read")


bundle, err := d.client.DefaultAPI.GetDagBundle(ctx, projectID, region, instanceID, name).Execute()
if err != nil {
var oapiErr *oapierror.GenericOpenAPIError

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This block "http.StatusNotFound" can be put into the tfutils.LogError() -> can be handled there.

if resp.Diagnostics.HasError() {
return
}
r.client = apiClient

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Info message missing

}
list, diags := types.ListValue(objType, elements)
if diags.HasError() {
return fmt.Errorf("%v", diags.Errors())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here: core.DiagsToError(diags)

// requireEnv collects a set of required env vars for these tests; if any are
// missing, skips the test with a clear message. Keeps test runs cheap when
// workflows-specific secrets aren't provisioned in the runner.
func requireEnv(t *testing.T, keys ...string) map[string]string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like this function but thought more about checking the general env variables here like TF_ACC_PROJECT_ID

"TF_ACC_WORKFLOWS_IDP_CLIENT_ID",
"TF_ACC_WORKFLOWS_IDP_CLIENT_SECRET",
"TF_ACC_WORKFLOWS_IDP_SCOPE",
"TF_ACC_WORKFLOWS_IDP_DISCOVERY_ENDPOINT",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Our acceptance tests are structured as following:
All needed information and additional instances should be defined in the acceptance test. There should be no need to set special things beforehand or creating other instances in a manual step. You can have a look at other acceptance tests. Besides some general environment variables like PROJECT_ID or ORGANIZATION_ID (+ some more) no special values are passed to an acceptance test.

Another thing: We have a Test...Min and a Test...Max for all those tests (where it makes sense of course).
Min test: only the required parameters are set in order to test that this is working as expected.
Max test: all parameters are set (to one example value if "a lot" of values would be possible).

"TF_ACC_WORKFLOWS_DAGS_GIT_URL",
"TF_ACC_WORKFLOWS_DAGS_GIT_BRANCH",
"TF_ACC_WORKFLOWS_DAGS_GIT_USER",
"TF_ACC_WORKFLOWS_DAGS_GIT_PAT",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here: I don't want to pass them before running the acceptance test

Comment thread go.mod
)

replace github.com/stackitcloud/stackit-sdk-go/services/workflows => /Users/cht/code/schwarz/stackit-sdk-go/services/workflows

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a reminder: Replace before merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants