Skip to content

Commit e1936e7

Browse files
authored
Modular mappers (#94)
* Adding the version to the Action title. * Got the v2 schema module ready to go, and it's working! * Major update to modularize the version mappers! - Each schema version now has a separate module and a separate test - There are now different workflow-based tests per schema version - Got to remove a bunch of code which was more complex than needed - We're ready to support additional schema versions now * Cleaning up print statements in test. * Getting ready for a future release.
1 parent 1e422f5 commit e1936e7

32 files changed

+1790
-1481
lines changed

.github/workflows/v2-automated-testing.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: DataDog Service Catalog
2+
name: DataDog Service Catalog v2
33
on:
44
push:
55
workflow_dispatch:
@@ -57,19 +57,16 @@ jobs:
5757
links: |
5858
- url: https://github.com/actions/toolkit
5959
type: repo
60-
provider: Github
6160
name: '@actions/toolkit'
6261
- name: AMI Version Status Dashboard
6362
url: https://thisisanentirelyfakeurl.seriouslythisisafakehostname.com/dashboard
6463
type: dashboard
6564
- name: GitHub Actions!
6665
url: https://github.com/features/actions
67-
provider: Github Docs
6866
type: doc
6967
- name: Some Runbook
7068
url: https://thisisanentirelyfakeurl.seriouslythisisafakehostname.com/runbook
7169
type: runbook
72-
provider: Confluence
7370
docs: |
7471
- name: Some Docs
7572
url: https://thisisanentirelyfakeurl.seriouslythisisafakehostname.com/docs

.github/workflows/v2.1-automated-testing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: DataDog Service Catalog
2+
name: DataDog Service Catalog v2.1
33
on:
44
push:
55
workflow_dispatch:

.github/workflows/v2.2-automated-testing.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: DataDog Service Catalog
2+
name: DataDog Service Catalog v2.2
33
on:
44
push:
55
workflow_dispatch:
@@ -54,7 +54,7 @@ jobs:
5454
- language:nodejs
5555
- updated:${{ steps.date.outputs.date }}
5656
- internet_accessible: false
57-
- schema-version: 2.2
57+
- schema-version: v2.2
5858
links: |
5959
- url: https://github.com/actions/toolkit
6060
type: repo

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog],
66
and this project adheres to [Semantic Versioning].
77

8+
## [3.0.0] - unreleased
9+
10+
> [!WARNING]
11+
> This version may include breaking changes!
12+
> There have been efforts made to not break backwards compatibility for either the org rules file
13+
> or the schema versions. That said, it is impossible to know how you have structured your files,
14+
> so please exercise caution when upgrading to the `v3` tag.
15+
16+
### Added
17+
18+
- Better tests for the various schema versions
19+
20+
### Changed
21+
22+
- Moved all of the field mapping from a common module for all versions, to version-specific modules
23+
- This will make it easier to add new schema version support without risking breakage to existing versions
24+
- This makes it much easier to test convenience functionality independently from the schema fields
25+
- So... many... tests...
26+
827
## [2.3.0] - 2024-02-07
928

1029
### Added
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`lib/convenienceMappings.cjs #getConvenienceFieldValues() - full set 1`] = `
4+
{
5+
"email": "[email protected]",
6+
"repo": "https://github.com/arcxp/datadog-service-catalog-metadata-provider",
7+
"slack": "https://fakeorg.slack.com/archives/A0000000000",
8+
"slack-support-channel": "https://fakeorg.slack.com/archives/A0000000001",
9+
}
10+
`;
11+
12+
exports[`lib/convenienceMappings.cjs #getConvenienceFieldValues() - partial set 1`] = `
13+
{
14+
"repo": "https://github.com/arcxp/datadog-service-catalog-metadata-provider",
15+
"slack": "https://fakeorg.slack.com/archives/A0000000000",
16+
"slack-support-channel": "https://fakeorg.slack.com/archives/A0000000001",
17+
}
18+
`;

__tests__/lib/__snapshots__/fieldMappings-schema.test.cjs.snap

-124
This file was deleted.

__tests__/lib/__snapshots__/fieldMappings.test.cjs.snap

-124
This file was deleted.

0 commit comments

Comments
 (0)