Skip to content

Conversation

arlimus
Copy link
Member

@arlimus arlimus commented Jul 9, 2025

This allows users to specify timestamps in a human-readable way. Particularly useful when dealing with YAML files, ie querypacks and policies, where you can now specify timestamps with a lot more grace and variety.

We are also breaking out the time parsing code into its own utility so the same parser is now shared between MQL and policy/querypack bundles.

Finally I found an issue with the numeric variants of RFC 822 and RFC 1123, since both are parsed in their non-numeric variants without error. Thus, the numeric variants are removed for now in the auto-detection.

Copy link
Contributor

github-actions bot commented Jul 9, 2025

Test Results

3 002 tests   - 1 325   2 998 ✅  - 1 325   1m 6s ⏱️ - 1m 22s
  117 suites  -   290       1 💤  -     3 
    2 files    -    28       3 ❌ +    3 

For more details on these failures, see this check.

Results for commit 3df9d69. ± Comparison against base commit 827fefe.

This pull request removes 1342 and adds 17 tests. Note that renamed tests count towards both.
go.mondoo.com/cnquery/v11/providers/ansible/play ‑ TestPlaybookDecoding
go.mondoo.com/cnquery/v11/providers/ansible/play ‑ TestPlaybookDecoding/load_default_playbook
go.mondoo.com/cnquery/v11/providers/ansible/play ‑ TestPlaybookDecoding/load_playbook_with_blocks_and_errors
go.mondoo.com/cnquery/v11/providers/ansible/play ‑ TestPlaybookDecoding/load_playbook_with_multiple_plays
go.mondoo.com/cnquery/v11/providers/ansible/play ‑ TestPlaybookDecoding/load_playbook_with_roles
go.mondoo.com/cnquery/v11/providers/ansible/play ‑ TestPlaybookDecoding/load_playbook_with_serial
go.mondoo.com/cnquery/v11/providers/ansible/play ‑ TestPlaybookDecoding/load_playbook_with_vars
go.mondoo.com/cnquery/v11/providers/ansible/play ‑ TestTaskDecoding
go.mondoo.com/cnquery/v11/providers/ansible/play ‑ TestTaskDecoding/load_task_with_blocks
go.mondoo.com/cnquery/v11/providers/ansible/play ‑ TestTaskDecoding/load_task_with_vars
…
go.mondoo.com/cnquery/v11/utils/timex ‑ TestParse
go.mondoo.com/cnquery/v11/utils/timex ‑ TestParse/RFC3339_with_format
go.mondoo.com/cnquery/v11/utils/timex ‑ TestParse/auto-detect_ANSIC
go.mondoo.com/cnquery/v11/utils/timex ‑ TestParse/auto-detect_DateOnly
go.mondoo.com/cnquery/v11/utils/timex ‑ TestParse/auto-detect_DateTime
go.mondoo.com/cnquery/v11/utils/timex ‑ TestParse/auto-detect_Kitchen
go.mondoo.com/cnquery/v11/utils/timex ‑ TestParse/auto-detect_RFC1123
go.mondoo.com/cnquery/v11/utils/timex ‑ TestParse/auto-detect_RFC3339
go.mondoo.com/cnquery/v11/utils/timex ‑ TestParse/auto-detect_RFC822
go.mondoo.com/cnquery/v11/utils/timex ‑ TestParse/auto-detect_RFC850
…

♻️ This comment has been updated with latest results.

@arlimus arlimus force-pushed the dom/human-time branch 2 times, most recently from 9d23429 to 3df9d69 Compare July 9, 2025 18:22
This allows users to specify timestamps in a human-readable way. Particularly useful when dealing with YAML files, ie querypacks and policies, where you can now specify timestamps with a lot more grace and variety.

We are also breaking out the time parsing code into its own utility so the same parser is now shared between MQL and policy/querypack bundles.

Finally I found an issue with the numeric variants of RFC 822 and RFC 1123, since both are parsed in their non-numeric variants without error. Thus, the numeric variants are removed for now in the auto-detection.

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Thank you @arlimus

@arlimus arlimus merged commit 8f45890 into main Jul 9, 2025
16 checks passed
@arlimus arlimus deleted the dom/human-time branch July 9, 2025 18:34
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants