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

(FACT-3474) Update facter schema, CONTRIBUTING.md, and add acceptance test to verify facts conform to schema #2746

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

AriaXLi
Copy link
Contributor

@AriaXLi AriaXLi commented Aug 7, 2024

This PR:

  • Updates facter.yaml to include any facts added since the schema was last
    updated
  • Updates CONTRIBUTING.md so contributors know to add new facts to facter.yaml
    schema
  • Adds an acceptance test that tests the facter output conforms to the schema
    on each platform

@AriaXLi AriaXLi force-pushed the FACT-3474/fact_schema branch from 519dfc0 to 16c4235 Compare August 7, 2024 18:47
@AriaXLi AriaXLi force-pushed the FACT-3474/fact_schema branch 4 times, most recently from ca225bb to a95aeda Compare August 8, 2024 23:05
@AriaXLi AriaXLi marked this pull request as ready for review August 8, 2024 23:05
@AriaXLi AriaXLi requested a review from a team as a code owner August 8, 2024 23:05
@AriaXLi AriaXLi force-pushed the FACT-3474/fact_schema branch 2 times, most recently from 975e021 to 88d5070 Compare August 9, 2024 15:31
@AriaXLi
Copy link
Contributor Author

AriaXLi commented Aug 9, 2024

ubuntu-20.04 failed because the disks.<devicename>.wwn fact doesn't currently exist in the schema...

@AriaXLi AriaXLi force-pushed the FACT-3474/fact_schema branch 6 times, most recently from ab10961 to aacafeb Compare August 14, 2024 18:16
@AriaXLi
Copy link
Contributor Author

AriaXLi commented Aug 14, 2024

On Windows, the networking.interfaces.dhcp fact is returning "" instead of a valid IPv4 value. This causes the schema.rb acceptance test to fail since the dhcp fact is not conforming to the schema. Due to this, the test will temporarily not be run on Windows until FACT-3479 is resolved

@AriaXLi AriaXLi closed this Aug 14, 2024
@AriaXLi AriaXLi reopened this Aug 14, 2024
@AriaXLi AriaXLi added the enhancement New feature or enhancement label Aug 14, 2024
CONTRIBUTING.md Outdated Show resolved Hide resolved
@bastelfreak
Copy link
Contributor

@AriaXLi thanks for the great PR! Do you know if there's an easy way for us to validate a factset, in json, against this schema? I'm asking because in FacterDB we collect a lot of factsets from running machines, but some are also generated with sed statements or manipulated.

@AriaXLi AriaXLi force-pushed the FACT-3474/fact_schema branch from aacafeb to ee47a8f Compare August 14, 2024 21:32
… to schema

This commit:
- Updates facter.yaml to include any facts added since the schema was last
  updated
- Updates CONTRIBUTING.md so contributors know to add new facts to facter.yaml
  schema
- Adds an acceptance test that tests the facter output conforms to the schema
  on each platform
@AriaXLi AriaXLi force-pushed the FACT-3474/fact_schema branch from ee47a8f to 6d52a38 Compare August 14, 2024 21:47
@AriaXLi
Copy link
Contributor Author

AriaXLi commented Aug 14, 2024

@AriaXLi thanks for the great PR! Do you know if there's an easy way for us to validate a factset, in json, against this schema? I'm asking because in FacterDB we collect a lot of factsets from running machines, but some are also generated with sed statements or manipulated.

Hi @bastelfreak thanks, glad I can help! Hmm I chose yaml since lib/schema/facter.yaml is yaml but I imagine you could probably use a factset in json by loading lib/schema/facter.yaml as a json file instead of yaml 🤔 not 100% sure though as I haven't tried it myself

@joshcooper joshcooper merged commit 06a0618 into puppetlabs:main Aug 16, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants