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

Adds Makefile Targets for API and UI and Updates the pre-submit PR script #277

Merged
merged 2 commits into from
Jul 7, 2021

Conversation

PuneetPunamiya
Copy link
Member

@PuneetPunamiya PuneetPunamiya commented Jun 11, 2021

  • This patch adds a Makefile targets for

    • API: Unit Test, Lint, Build, Update Golden files
    • UI: Unit Test, Lint, Build
    • Yamllint check
$ make help    
test                 run all Unit Tests
lint                 check all Lints
api-check            all API checks
ui-check             all UI checks
goa-gen              generate API Design
generated            update the golden files
api-lint             run API Lint
api-test             run API Unit Test
api-build            generate the API binary
ui-lint              run UI Lint
ui-test              run UI Unit Test
ui-build             generate the UI binary
yaml-lint            run YAML Lint
help                 print this help

Signed-off-by: Puneet Punamiya ppunamiy@redhat.com

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

@tekton-robot tekton-robot requested review from sm43 and sthaha June 11, 2021 13:17
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 11, 2021
@sm43
Copy link
Member

sm43 commented Jun 14, 2021

could you document the command available through make file and what they do?

@PuneetPunamiya
Copy link
Member Author

could you document the command available through make file and what they do?

Where that file should be located ??

@sm43
Copy link
Member

sm43 commented Jun 14, 2021

could you document the command available through make file and what they do?

Where that file should be located ??

Development.md
also if we have a command which does goa gen - run unit test - lint and everything needed before creating pr
we can add that in pr template similar to tkn cli

@PuneetPunamiya
Copy link
Member Author

could you document the command available through make file and what they do?

Where that file should be located ??

Development.md
also if we have a command which does goa gen - run unit test - lint and everything needed before creating pr
we can add that in pr template similar to tkn cli

Sounds good will update the pr thanks 👍🏻


CI=true npm test || {
make ui-test || {
Copy link
Member

Choose a reason for hiding this comment

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

why are we removing CI=true ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have added that in the specified make target
For e.g.

# Make target for UI Unit Test
.PHONY: ui-test
ui-test:
        @echo "----------------------------"
        @echo "-- Running UI Unit Tests --"
        @echo "----------------------------"
        cd ui && npm clean-install && CI=true npm test

test/presubmit-tests.sh Show resolved Hide resolved
@vinamra28
Copy link
Member

should we add make help as well which can list all possible subcommands?

@vinamra28
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 21, 2021
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 30, 2021
@vinamra28
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 1, 2021
Makefile Outdated
@echo "----------------------------"
@echo "- Generating v1 API Design... "
@echo "----------------------------"
cd api && cd v1 && goa gen github.com/tektoncd/hub/api/v1/design
Copy link
Member

Choose a reason for hiding this comment

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

how does this work?
cd api && goa gen github.com/tektoncd/hub/api/design
when we do this.. does the directory context changes only for that command?
and
again below it does
cd api/v1 so each command runs in a separate context/terminal?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes the directory content changes only for that command and also the command runs in a separate context

@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 1, 2021
@vinamra28
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2021
api/update.sh Outdated
@@ -0,0 +1 @@
go test $(go list -f '{{ .ImportPath }} {{ .TestImports }}' ./... | grep gotest.tools/v3/golden | awk '{print $1}' | tr '\n' ' ') -test.update-golden=true
Copy link
Member

Choose a reason for hiding this comment

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

does this requires to be in separate file?

Copy link
Member

Choose a reason for hiding this comment

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

yeah I guess.... we can use it independently as well

@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2021
@sm43
Copy link
Member

sm43 commented Jul 7, 2021

/approve
/meow

@tekton-robot
Copy link

@sm43: cat image

In response to this:

/approve
/meow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sm43

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 7, 2021
Makefile Outdated
@echo "----------------------------"
@echo "-- Generating Golden Files... --"
@echo "----------------------------"
cd api && go mod vendor && bash update.sh
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
cd api && go mod vendor && bash update.sh
cd api && go mod vendor && bash update-golden-files.sh

  - This patch adds a Makefile targets for

     - API: GOA Generation, Unit Test, Lint, Build, Update Golden files
     - UI: Unit Test, Lint, Build
     - Yamllint check

Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
@vinamra28
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2021
@tekton-robot tekton-robot merged commit 9f05851 into tektoncd:main Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants