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

Cant sync policies #133

Open
Eggwise opened this issue Dec 28, 2024 · 2 comments
Open

Cant sync policies #133

Eggwise opened this issue Dec 28, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@Eggwise
Copy link

Eggwise commented Dec 28, 2024

Cant sync policies collection with directus-sync

Invalid enum value in directus-sync onlyCollections configuration (policies)

Description

When running directus-sync push command, the tool fails with an enum validation error for the onlyCollections configuration. The tool doesn't accept 'policies' as a valid collection name, despite it being a standard Directus collection type.

Steps to Reproduce

  1. Configure baseConfig.js with the following collections:
module.exports = {
  onlyCollections: [
    'roles',
    'permissions',
    'settings',
    'folders',
    'flows',
    'operations',
    'presets',
    'policies',
  ],
};
  1. Run the directus-sync push command.
directus-sync push
  1. Run directus-sync push command

Current Behavior

The command fails with the following error:

ERROR: Config file: [onlyCollections,7] Invalid enum value. Expected 'dashboards' | 'flows' | 'folders' | 'operations' | 'panels' | 'permissions' | 'presets' | 'roles' | 'settings' | 'translations', received 'policies'

Expected Behavior

The 'policies' collection should be accepted as a valid collection type for synchronization, as it is a standard Directus system collection.

Environment

"directus-extension-sync": "3.0.2"
  • Node.js version: v20.12.2 (NVM)
  • Operating System: Macbook pro M2

Additional Context

The error occurs in the Zod schema validation within the directus-sync tool. The enum of allowed collections appears to be missing the 'policies' collection type, despite it being a valid Directus system collection.

@Eggwise
Copy link
Author

Eggwise commented Dec 28, 2024

when i use pnpm exec instead of npx it works, seems like a weird cache thing ?

@EdouardDem
Copy link
Member

@Eggwise It's wreid because the policies is in the Collection enum used by Zod :

Did you use an old version of directus-sync (not directus-extension-sync) ?

@EdouardDem EdouardDem added the help wanted Extra attention is needed label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants