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

fix(declarative-config): set hash when config is loaded #9911

Merged
merged 3 commits into from
Dec 26, 2022
Merged

Conversation

samugi
Copy link
Member

@samugi samugi commented Dec 7, 2022

Ensure the hash field is correctly configured when the declarative configuration is loaded.

@samugi samugi linked an issue Dec 7, 2022 that may be closed by this pull request
1 task
@samugi samugi marked this pull request as draft December 7, 2022 16:09
@samugi samugi marked this pull request as ready for review December 7, 2022 16:24
@samugi samugi marked this pull request as draft December 7, 2022 16:58
@samugi samugi marked this pull request as ready for review December 7, 2022 17:47
@@ -660,6 +660,11 @@ end
declarative.unique_field_key = unique_field_key


local function config_is_empty(entities)
-- empty configuration has no entries other than workspaces
return entities["workspaces"] and tablex.size(entities) == 1
Copy link
Member

Choose a reason for hiding this comment

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

You can use https://github.com/openresty/luajit2#tablenkeys for tablex.size. Might be faster for large configs.

Also, do we need to do and entities.workspace just to be safe? I'm not sure if it is possible to have an entities that has not workspace or will it always be added by the parser.

Copy link
Member Author

@samugi samugi Dec 13, 2022

Choose a reason for hiding this comment

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

@dndx

You can use https://github.com/openresty/luajit2#tablenkeys for tablex.size. Might be faster for large configs.

Done, thanks!

do we need to do and entities.workspace just to be safe?

Do you mean the entities["workspaces"] check in my return statement above? That should be always populated here:

self.schema:insert_default_workspace_if_not_given(entities)
Or were you referring to something else?

@chronolaw
Copy link
Contributor

Due to #9890, we should rebase this PR.

Ensure the configuration hash field is correctly configured when the
declarative configuration is loaded on startup.
ensure the default (empty) config returns the appropriate hash that
identifies the empty configuration: 00000000000000000000000000000000
@samugi
Copy link
Member Author

samugi commented Dec 14, 2022

Due to #9890, we should rebase this PR.

thank you @chronolaw, done.

@samugi samugi requested a review from dndx December 15, 2022 20:24
@dndx dndx merged commit 9e44850 into master Dec 26, 2022
@dndx dndx deleted the fix/FT-3652 branch December 26, 2022 06:03
oowl pushed a commit that referenced this pull request Aug 15, 2024
… parameters (#9911)

After the query parameters of the graphql are parsed into AST, there are three types: listType, nonNullType, and namedType.
Are their structures different, so the way of obtaining variable types from the structure is also different.

This PR is compatible with different structures for obtaining variable types.

Fix FTI-6153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invalid "configuration_hash" despite valid configuration
6 participants