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

feat: Add task to SDK #2099

Merged
merged 49 commits into from
Oct 9, 2023
Merged

feat: Add task to SDK #2099

merged 49 commits into from
Oct 9, 2023

Conversation

sfc-gh-asawicki
Copy link
Collaborator

@sfc-gh-asawicki sfc-gh-asawicki commented Oct 5, 2023

Changes

  • Add task to SDK:
    • Add implementation based on references
  • Extend the generator:
    • add findings to readme
    • add ShowByID generation
    • add custom operation generation (for EXECUTE)
    • fix formatting in different generated places
    • add no quotes, equals, and no_equals tags to transformers
    • add utility builder methods for DSL for common types (in Show: Like, In, StartsWith, Limit, Terse, in Create: tags, session parameters, in Alter: SessionParameters - set and unset)
    • add new validation type (for generate invocation of existing validate() method for common existing types)
    • add boolean assignments
    • refactor assignments and introduce assignment for convenience methods for every type (Assignment and OptionalAssignment)
  • Misc:
    • Fix copy-paste names in session policy integration tests
    • Update resource table in README
    • Add usage for generator to README

The generator was used as part of this implementation (check the tasks_def.go file first). After generation, the following changes were applied:

  • Remove duplicated convert()
  • Use Describe as ShowByID (because returned structures are the same)
  • Change types in taskDBRow to sql.NullString (all nullable + all the ones that are not a part of SHOW TERSE output)
  • Add mapping to taskDBRow
  • Modify minimal valid options for Create and for Show
  • Add another test for exactly one validation
  • Add branches for Alter tests
  • Remove the all options test from Drop and Describe
  • Add the ID() method to Task
  • Change AllowOverlappingExecution to bool after consideration (still string in def)
  • Remove id from TestTasks_Show
  • Fill out unit tests
  • Fill out acceptance tests

Test Plan

  • unit tests (SQL generation and validations)
  • integration tests (SQL invocation)
  • acceptance tests (nothing should break yet)

References

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Integration tests failure for 42305f5bcaaf892e9cbf81b942ec4fde3a0e2e8e

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Integration tests failure for ecfec6cc445a59cc5b133a6bf82ae81a73f208ac

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Integration tests failure for 3de73fb16f23458723a0d8f073d2fc535ffccbf6

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Integration tests success for 9b5df272043ce76f81ed1962390c30575a567d4a

@sfc-gh-asawicki sfc-gh-asawicki marked this pull request as ready for review October 5, 2023 17:06
pkg/sdk/tasks_gen_integration_test.go Outdated Show resolved Hide resolved
pkg/sdk/tasks_impl_gen.go Show resolved Hide resolved
pkg/sdk/poc/generator/keyword_builders.go Outdated Show resolved Hide resolved
pkg/sdk/poc/generator/keyword_builders.go Outdated Show resolved Hide resolved
pkg/sdk/tasks_def.go Show resolved Hide resolved
pkg/sdk/tasks_def.go Show resolved Hide resolved
pkg/sdk/tasks_def.go Show resolved Hide resolved
pkg/sdk/tasks_gen_integration_test.go Outdated Show resolved Hide resolved
pkg/sdk/tasks_gen_integration_test.go Show resolved Hide resolved
pkg/sdk/tasks_gen_integration_test.go Show resolved Hide resolved
pkg/sdk/tasks_gen_integration_test.go Show resolved Hide resolved
pkg/sdk/tasks_gen_integration_test.go Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Oct 6, 2023

Integration tests success for 7ce0f7fcdd63b5b633e5e879dec72820040eb772

@sfc-gh-asawicki sfc-gh-asawicki merged commit d52f334 into main Oct 9, 2023
8 checks passed
@sfc-gh-asawicki sfc-gh-asawicki deleted the add-task-to-sdk branch October 9, 2023 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants