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

Add team and teams datasources #129

Merged
merged 2 commits into from
Aug 4, 2023
Merged

Add team and teams datasources #129

merged 2 commits into from
Aug 4, 2023

Conversation

sofuture
Copy link
Contributor

Description

@splittingred this is the changes from #121 -- there were a variety of issues with the integration tests, and 2 missing lines in provider/provider.go (now added). We can get the fixes in here, and then merge back.

@sofuture sofuture changed the base branch from jz/v0.3.3 to main July 31, 2023 22:58
@splittingred
Copy link
Contributor

splittingred commented Aug 3, 2023

@sofuture - Great, thanks! What's needed to complete this work / get this merged+released?

@sofuture
Copy link
Contributor Author

sofuture commented Aug 3, 2023

@splittingred a few things --
the providers needed registered: ab96fc6
and the team tests didn't work/reflect the API, fixed some of them here: e3bc16d

I'll take a look at teams acceptance tests shortly.

@sofuture sofuture changed the title Jz/put back 121 Add team and teams datasources Aug 3, 2023
Jeff Zellner added 2 commits August 3, 2023 16:14
update changelog

fix team tests

add test for teams datasource query
Copy link
Contributor

@nearbycoder nearbycoder left a comment

Choose a reason for hiding this comment

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

Verified that this is working locally

terraform {
  required_providers {
    firehydrant = {
      source  = "firehydrant/firehydrant"
      version = "0.1.4"
    }
  }
}

provider "firehydrant" {
  api_key              = "fhb-youwish"
  firehydrant_base_url = "https://api.local.firehydrant.io/v1/"
}


data "firehydrant_teams" "all_teams" {
}

data "firehydrant_teams" "test_teams" {
  query = "Test"
}
{
  "version": 4,
  "terraform_version": "1.5.4",
  "serial": 2,
  "lineage": "2edce89a-0660-d597-2d6c-113fc6dfc443",
  "outputs": {},
  "resources": [
    {
      "mode": "data",
      "type": "firehydrant_teams",
      "name": "all_teams",
      "provider": "provider[\"registry.terraform.io/firehydrant/firehydrant\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "id": "does-not-matter",
            "query": null,
            "teams": [
              {
                "description": "",
                "id": "c4e2fa1d-7d57-456c-8401-2019b0b2ebcc",
                "name": "Firefighters",
                "owned_service_ids": [],
                "service_ids": [],
                "slug": "firefighters"
              },
              {
                "description": "This team does it all.",
                "id": "ef32c1a7-a292-4271-b137-5351a687cb6c",
                "name": "Frontend",
                "owned_service_ids": [],
                "service_ids": [],
                "slug": "frontend"
              },
              {
                "description": "This team does it all.",
                "id": "a7dcb2a9-133d-4757-aaa1-3277840b5276",
                "name": "Infrastructure SREs",
                "owned_service_ids": [],
                "service_ids": [],
                "slug": "infrastructure-sres"
              },
              {
                "description": "This team does it all.",
                "id": "ebba30cf-a4f4-4ff8-9568-a078cc32281a",
                "name": "Laddertruck SREs",
                "owned_service_ids": [],
                "service_ids": [],
                "slug": "laddertruck-sres"
              },
              {
                "description": "",
                "id": "82ca3ae5-f357-48ce-9165-28f702affd07",
                "name": "Test",
                "owned_service_ids": [],
                "service_ids": [],
                "slug": "test"
              }
            ]
          },
          "sensitive_attributes": []
        }
      ]
    },
    {
      "mode": "data",
      "type": "firehydrant_teams",
      "name": "test_teams",
      "provider": "provider[\"registry.terraform.io/firehydrant/firehydrant\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "id": "does-not-matter",
            "query": "Test",
            "teams": [
              {
                "description": "",
                "id": "82ca3ae5-f357-48ce-9165-28f702affd07",
                "name": "Test",
                "owned_service_ids": [],
                "service_ids": [],
                "slug": "test"
              }
            ]
          },
          "sensitive_attributes": []
        }
      ]
    }
  ],
  "check_results": null
}

@sofuture sofuture merged commit af105bc into main Aug 4, 2023
1 check passed
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.

None yet

3 participants