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

[FEATURE] Use QuickType to generate schemas/DTO files via GitHub Actions #268

Open
guibranco opened this issue Jul 23, 2023 · 1 comment · May be fixed by #573
Open

[FEATURE] Use QuickType to generate schemas/DTO files via GitHub Actions #268

guibranco opened this issue Jul 23, 2023 · 1 comment · May be fixed by #573
Labels
CI Continuous Integration / Pipeline Code Quality Code Quality dependencies Pull requests that update a dependency file 📝 documentation Tasks related to writing or updating documentation enhancement A enhancement to the project examples Examples gitauto GitAuto label to trigger the app in a issue. good first issue A issue for someone self assign and help me =D hacktoberfest Participation in the Hacktoberfest event help wanted Feel free to take this issue for you and help me! :octocat: github-actions GitHub Actions for automation and CI/CD schema Request of new schema/model 🛠 WIP Work in progress

Comments

@guibranco
Copy link
Owner

guibranco commented Jul 23, 2023

Description

Implement a GitHub Actions workflow to automatically generate schemas and Data Transfer Object (DTO) files using QuickType. This will help keep our data models up-to-date and synchronized with our data sources, streamlining the development process.

Why We Need This

  1. Automation: Automatically generating schemas and DTO files ensures they are always up-to-date with the latest changes, reducing manual effort and the risk of inconsistencies.
  2. Consistency: Using a consistent tool like QuickType across the team helps maintain uniform data models and reduces errors.
  3. Efficiency: Integrating schema generation into our CI/CD pipeline will speed up development and ensure that data models are always accurate.

Tech Notes

  1. QuickType Integration:

    • QuickType can generate schemas and DTO files from JSON, TypeScript, or other data formats.
    • We need to set up QuickType to run as part of our GitHub Actions workflow.
  2. GitHub Actions Workflow Setup:

    • Create a new workflow file in .github/workflows directory, e.g., generate-schemas.yml.
    • Define a job in the workflow to install QuickType and run it to generate the required files.
  3. Workflow File Example:

    name: Generate Schemas/DTO Files
    
    on:
      push:
        branches:
          - main
      pull_request:
        branches:
          - main
    
    jobs:
      generate:
        runs-on: ubuntu-latest
    
        steps:
          - name: Checkout code
            uses: actions/checkout@v3
    
          - name: Set up Node.js
            uses: actions/setup-node@v3
            with:
              node-version: "14"
    
          - name: Install QuickType
            run: npm install -g quicktype
    
          - name: Generate Schemas/DTO Files
            run: quicktype -s json -o src/schemas.ts data/example.json
    
          - name: Commit generated files
            run: |
              git config --global user.name 'GitHub Actions'
              git config --global user.email 'actions@github.com'
              git add src/schemas.ts
              git commit -m 'Update generated schemas/DTO files'
              git push
  4. QuickType Command Details:

    • Customize the quicktype command based on your data source and output requirements.
    • Refer to QuickType CLI documentation for additional options and configurations.
  5. File Management:

    • Ensure that the generated files are correctly placed in the repository and managed according to your project’s file structure.
    • Set up .gitignore if there are any temporary files or outputs that should not be committed.

Additional Notes

  • Ensure that the workflow is tested in a staging environment before deploying it to production.
  • Consider adding tests to verify the accuracy of generated schemas/DTO files.
  • Document the process and any configurations in the repository’s README or contributing guidelines.
@guibranco guibranco added enhancement A enhancement to the project help wanted Feel free to take this issue for you and help me! good first issue A issue for someone self assign and help me =D dependencies Pull requests that update a dependency file examples Examples :octocat: github-actions GitHub Actions for automation and CI/CD 📝 documentation Tasks related to writing or updating documentation CI Continuous Integration / Pipeline Code Quality Code Quality investigating Under investigation labels Jul 23, 2023
@guibranco guibranco changed the title Use QuickType on daily updates to generate schemas/dto files Use QuickType to generate schemas/DTO files Aug 25, 2023
@guibranco guibranco added the hacktoberfest Participation in the Hacktoberfest event label Oct 7, 2023
@guibranco guibranco changed the title Use QuickType to generate schemas/DTO files [FEATURE] Use QuickType to generate schemas/DTO files May 15, 2024
@guibranco guibranco removed the investigating Under investigation label Aug 16, 2024
@guibranco guibranco changed the title [FEATURE] Use QuickType to generate schemas/DTO files [FEATURE] Use QuickType to generate schemas/DTO files via GitHub Actions Sep 13, 2024
@github-actions github-actions bot added the schema Request of new schema/model label Sep 13, 2024
@gitauto-ai gitauto-ai bot added the gitauto GitAuto label to trigger the app in a issue. label Oct 22, 2024
Copy link

gitauto-ai bot commented Oct 22, 2024

Hey, I'm a bit lost here! Not sure which file I should be fixing. Could you give me a bit more to go on? Maybe add some details to the issue or drop a comment with some extra hints? Thanks!

Have feedback or need help?
Feel free to email info@gitauto.ai.

@gstraccini gstraccini bot added the 🛠 WIP Work in progress label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration / Pipeline Code Quality Code Quality dependencies Pull requests that update a dependency file 📝 documentation Tasks related to writing or updating documentation enhancement A enhancement to the project examples Examples gitauto GitAuto label to trigger the app in a issue. good first issue A issue for someone self assign and help me =D hacktoberfest Participation in the Hacktoberfest event help wanted Feel free to take this issue for you and help me! :octocat: github-actions GitHub Actions for automation and CI/CD schema Request of new schema/model 🛠 WIP Work in progress
Projects
None yet
1 participant