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

Add git options (commit, stage, and no git repository) #270

Merged
merged 8 commits into from
Jul 10, 2024

Conversation

tomasohCHOM
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Problem/Feature

Please include a description of the problem or feature this PR is addressing.

Description of Changes:

  • Allow users to create a new project with the following Git options: init repo + commit the changes, init repo + stage the changes, proceed without creating a git repo
  • Create git flag to allow for the same options as in the interactive UI
  • Update the docs to include the new git flag

Checklist

@tomasohCHOM
Copy link
Contributor Author

I am pretty sure the workflow is failing because I added the extra flag --git and it will just not do anything since it expects a UI response otherwise. I pinpointed the file .github/workflows/generate-linter.yml where the action is being run. Would it be okay if I added --git none to fix the issue?

@Ujstor
Copy link
Collaborator

Ujstor commented Jul 8, 2024

@tomasohCHOM You need to update the workflow because a new flag was introduced, and that is the reason why the workflow is failing

matrix:
        framework:
          [chi, gin, fiber, gorilla/mux, httprouter, standard-library, echo]
        driver:
          [mysql, postgres, sqlite, mongo, redis, none]
        git:
          [commit, stage, skip}
        advanced:
          [htmx, githubaction, websocket]
 - name: build templates
        run: script -q /dev/null -c "go run main.go create -n ${{ matrix.framework }} -f ${{ matrix.framework}} -d ${{matrix.driver}}  -g ${{matrix.git}}  --advanced true --feature ${{ matrix.advanced }}" /dev/null

Action will run the updated workflow on your PR.

@tomasohCHOM
Copy link
Contributor Author

@Ujstor for sure, I'll do that right now!

@tomasohCHOM
Copy link
Contributor Author

tomasohCHOM commented Jul 8, 2024

@Ujstor damn it seems that adding those three more flag options will exceed the 256 matrix size limit it seems.

@Ujstor
Copy link
Collaborator

Ujstor commented Jul 8, 2024

Hmm, interesting. I didn't know what a final limit is. Maybe we can constrain the maximum parallel jobs? Not sure if this would work, but let's give it a try.

jobs:
  framework_matrix:
    strategy:
      max-parallel: 128
      matrix:
        framework:
         [chi, gin, fiber, gorilla/mux, httprouter, standard-library, echo]
        driver:
          [mysql, postgres, sqlite, mongo, redis, none]
        advanced:
          [htmx, githubaction, websocket]
        git:
          [commit, stage, skip]

@tomasohCHOM
Copy link
Contributor Author

No luck with that unfortunately. It says in the GitHub documentation:

"A matrix will generate a maximum of 256 jobs per workflow run. This limit applies to both GitHub-hosted and self-hosted runners."

If we somehow can break it into multiple workflows, it might work. The flag that I added however does not contribute anything to the templates themselves, so if it is not 100% necessary, we could add a placeholder flag in build templates to at least make the workflow run, like:

- name: build templates
        run: script -q /dev/null -c "go run main.go create -n ${{ matrix.framework }} -f ${{ matrix.framework}} -d ${{matrix.driver}}  -g skip  --advanced true --feature ${{ matrix.advanced }}" /dev/null

@Ujstor
Copy link
Collaborator

Ujstor commented Jul 8, 2024

No luck with that unfortunately. It says in the GitHub documentation:

"A matrix will generate a maximum of 256 jobs per workflow run. This limit applies to both GitHub-hosted and self-hosted runners."

If we somehow can break it into multiple workflows, it might work. The flag that I added however does not contribute anything to the templates themselves, so if it is not 100% necessary, we could add a placeholder flag in build templates to at least make the workflow run, like:

- name: build templates
        run: script -q /dev/null -c "go run main.go create -n ${{ matrix.framework }} -f ${{ matrix.framework}} -d ${{matrix.driver}}  -g skip  --advanced true --feature ${{ matrix.advanced }}" /dev/null

Breaking it into two pieces was also on my mind. For now, your proposal is okay, but better change flag to commit, that way, we can catch bugs and also remove max-parallel.

@tomasohCHOM
Copy link
Contributor Author

Got it, let me add that for now. Thank you!

Copy link
Collaborator

@Ujstor Ujstor left a comment

Choose a reason for hiding this comment

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

Works as expected, nice PR. Only one small thing, please add a new CLI screenshot to the root and docs public folder. After that, it is good to go.
blueprint_1

@tomasohCHOM
Copy link
Contributor Author

Thank you!! Will add it in just a second 👍

@Ujstor
Copy link
Collaborator

Ujstor commented Jul 10, 2024

@tomasohCHOM Check also README.md file and add the --git commit flag in the appropriate places.

@tomasohCHOM
Copy link
Contributor Author

tomasohCHOM commented Jul 10, 2024

@Ujstor Ok I added the --git commit option for each of the snippets that needed it. I put the flag at the end of each snippet because it's the option that appears last in the UI. I also ensured that docs was updated with the new flag and it is through docs/creating-project/project-init.md (Also the workflow is failing for some reason even though the only file I modified was README.md).

@Ujstor
Copy link
Collaborator

Ujstor commented Jul 10, 2024

I reran them manually, and now they are passing. More often than not, there is an issue with actions.

Copy link
Collaborator

@Ujstor Ujstor left a comment

Choose a reason for hiding this comment

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

LGTM

@Ujstor Ujstor merged commit 323bc07 into Melkeydev:main Jul 10, 2024
127 checks passed
@tomasohCHOM tomasohCHOM deleted the add/git-options branch July 10, 2024 19:40
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.

2 participants