Skip to content

Conversation

@lakshmi-kannan
Copy link
Contributor

@lakshmi-kannan lakshmi-kannan commented Jun 12, 2017

Opened in favor of #3376

Output

(virtualenv)vagrant@st2dev /m/s/s/st2 ❯❯❯ make .lint-api-spec                                            feature/lint_openapi_spec ✭ ✱ ◼

================== Lint API spec ====================

st2common/bin/st2-validate-api-spec --generate
2017-05-03 16:36:20,105 ERROR [-] API model field "x-api-model" not defined for definition "TokenValidationRequest".
2017-05-03 16:36:20,107 ERROR [-] API model field "x-api-model" not defined for definition "PolicyCreate".
2017-05-03 16:36:20,107 ERROR [-] API model field "x-api-model" not defined for definition "PacksRegister".
2017-05-03 16:36:20,108 ERROR [-] API model field "x-api-model" not defined for definition "TriggerRequest".
2017-05-03 16:36:20,109 ERROR [-] API model field "x-api-model" not defined for definition "PolicyTypeList".
2017-05-03 16:36:20,110 ERROR [-] API model field "x-api-model" not defined for definition "SensorType".
2017-05-03 16:36:20,110 ERROR [-] API model field "x-api-model" not defined for definition "Trigger".
2017-05-03 16:36:20,111 ERROR [-] API model field "x-api-model" not defined for definition "KeyValuePair".
2017-05-03 16:36:20,111 ERROR [-] API model field "x-api-model" not defined for definition "PacksContentRegisterType".
2017-05-03 16:36:20,114 ERROR [-] API model field "x-api-model" not defined for definition "TracesList".
2017-05-03 16:36:20,114 ERROR [-] API model field "x-api-model" not defined for definition "TriggerTypeRequest".
2017-05-03 16:36:20,115 ERROR [-] API model field "x-api-model" not defined for definition "PacksList".
2017-05-03 16:36:20,116 ERROR [-] API model field "x-api-model" not defined for definition "AliasExecution".
2017-05-03 16:36:20,116 ERROR [-] API model field "x-api-model" not defined for definition "RuleType".
2017-05-03 16:36:20,117 ERROR [-] API model field "x-api-model" not defined for definition "PacksInstall".
2017-05-03 16:36:20,119 ERROR [-] API model field "x-api-model" not defined for definition "RunnerType".
2017-05-03 16:36:20,120 ERROR [-] API model field "x-api-model" not defined for definition "ActionAliasMatchRequest".
2017-05-03 16:36:20,121 ERROR [-] API model field "x-api-model" not defined for definition "ActionParametersSubSchema".
2017-05-03 16:36:20,121 ERROR [-] API model field "x-api-model" not defined for definition "ActionAliasRequest".
2017-05-03 16:36:20,121 ERROR [-] API model field "x-api-model" not defined for definition "Webhook".
2017-05-03 16:36:20,121 ERROR [-] API model field "x-api-model" not defined for definition "PacksUninstall".
2017-05-03 16:36:20,121 ERROR [-] API model field "x-api-model" not defined for definition "WebhookBody".
2017-05-03 16:36:20,121 ERROR [-] API model field "x-api-model" not defined for definition "TriggerInstance".
2017-05-03 16:36:20,121 ERROR [-] API model field "x-api-model" not defined for definition "TokenValidationResult".
2017-05-03 16:36:20,121 ERROR [-] API model field "x-api-model" not defined for definition "LiveAction".
2017-05-03 16:36:20,121 ERROR [-] API model field "x-api-model" not defined for definition "PackConfig".
2017-05-03 16:36:20,122 ERROR [-] API model field "x-api-model" not defined for definition "ActionAliasHelp".
2017-05-03 16:36:20,124 ERROR [-] API model field "x-api-model" not defined for definition "PacksSearchShow".
2017-05-03 16:36:20,124 ERROR [-] API model field "x-api-model" not defined for definition "NotificationPropertySubSchema".
2017-05-03 16:36:20,125 ERROR [-] API model field "x-api-model" not defined for definition "RuleEnforcementsList".
2017-05-03 16:36:20,126 ERROR [-] API model field "x-api-model" not defined for definition "PackIndex".
2017-05-03 16:36:20,126 ERROR [-] API model field "x-api-model" not defined for definition "ActionAliasMatch".
2017-05-03 16:36:20,126 ERROR [-] API model field "x-api-model" not defined for definition "ValidationError".
2017-05-03 16:36:20,127 ERROR [-] API model field "x-api-model" not defined for definition "TimersList".
2017-05-03 16:36:20,127 ERROR [-] API model field "x-api-model" not defined for definition "PackView".
2017-05-03 16:36:20,129 ERROR [-] API model field "x-api-model" not defined for definition "Token".
2017-05-03 16:36:20,130 ERROR [-] API model field "x-api-model" not defined for definition "DataFilesSubSchema".
2017-05-03 16:36:20,130 ERROR [-] API model field "x-api-model" not defined for definition "Error".
2017-05-03 16:36:20,130 ERROR [-] API model field "x-api-model" not defined for definition "TokenRequest".
2017-05-03 16:36:20,131 ERROR [-] API model field "x-api-model" not defined for definition "KeyValuePairRequest".
2017-05-03 16:36:20,132 ERROR [-] API model field "x-api-model" not defined for definition "ExecutionFilters".
2017-05-03 16:36:20,132 ERROR [-] API model field "x-api-model" not defined for definition "PolicyList".
2017-05-03 16:36:20,132 ERROR [-] API model field "x-api-model" not defined for definition "Execution".
2017-05-03 16:36:20,133 ERROR [-] API model field "x-api-model" not defined for definition "PackConfigCreate".
2017-05-03 16:36:20,134 ERROR [-] API model field "x-api-model" not defined for definition "ActionParameters".
2017-05-03 16:36:20,134 ERROR [-] API model field "x-api-model" not defined for definition "TriggerType".
2017-05-03 16:36:20,134 ERROR [-] API model field "x-api-model" not defined for definition "ExecutionRequest".
2017-05-03 16:36:20,134 ERROR [-] API model field "x-api-model" not defined for definition "PackConfigView".
2017-05-03 16:36:20,134 ERROR [-] API model field "x-api-model" not defined for definition "PackConfigContent".
make: *** [.lint-api-spec] Error 1
(virtualenv)vagrant@st2dev /m/s/s/st2 ❯❯❯

Lakshmi Kannan added 7 commits April 24, 2017 16:15
* master: (208 commits)
  adding bug fix to the end of changelog message
  Adding changelog entry
  Adding simple test
  Adding percent parsing and various debug messages
  Lint and unit tests fixes
  Enable trigger parameters validation check
  Change sleep time for the worker shutdown test
  Name is required, ref is optional
  Trigger and TriggerType models should have ref field
  Revert unneeded changes
  Cleanup log changes
  Log debug rule query
  Revert back trigger to StringField in trigger instance
  Fix duplicate remove from running liveactions set
  Checkpoint #3
  Checkpoint #2
  Checkpoint
  Minor fix to mistral itests
  action raises ValueError for unknown uuid type. Fixes test and added enum to meta
  Fix style - use 4 spaces for a tab, throw instead of returning false.
  ...
@Kami
Copy link
Member

Kami commented Jun 12, 2017

So far LGTM 👍

@lakshmi-kannan lakshmi-kannan changed the title WIP: OpenAPI spec linter #2 (Circle CI check) OpenAPI spec linter #2 (Circle CI check) Jun 12, 2017
@arm4b arm4b added this to the 2.3.0 milestone Jun 12, 2017
@arm4b
Copy link
Member

arm4b commented Jun 12, 2017

We're not including these new checks in CircleCI yet?

@lakshmi-kannan
Copy link
Contributor Author

We're not including these new checks in CircleCI yet?

@armab Not yet. Then the CI will always fail :P. This is for kami to identify which openapispec models miss a X-API-Model parameter. He cannot eye-ball it apparently.

@Kami
Copy link
Member

Kami commented Jun 12, 2017

Looks like you added make target but you didn't actually add this target run to Circle CI.

Is this intentional? I kinda assume we perhaps want to add it to Circle CI, but make failures non-fatal until we address all the issues, then we turn failures into fatal build failures.

Edit: Looks like @armab had the same question above :P

@Kami
Copy link
Member

Kami commented Jun 12, 2017

LGTM

requirements.txt Outdated
oslo.utils<3.1.0
paramiko<2.2,>=2.1.2
passlib==1.6.5
prance
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to add corresponding entry to some component in-requirements.txt and fixed-requirements.txt since this file is auto-generated?

Makefile Outdated
@echo
@echo "================== Lint API spec ===================="
@echo
st2common/bin/st2-validate-api-spec --generate
Copy link
Member

Choose a reason for hiding this comment

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

Also a good idea to activate virtualenv here, same as we do for other tasks - . $(VIRTUALENV_DIR)/bin/activate; command

Lakshmi Kannan added 3 commits June 13, 2017 08:10
* master: (59 commits)
  Add echo.
  Fix more syntax issues in changelog file.
  Fix syntax error.
  Add rst-check make target which checks CHANGELOG.rst for syntax errors and run it on Circle CI.
  Add rstcheck to test requirements file.
  Update changelog.
  Improve comments.
  Update config loader so a default value for an attribute from a config schema is set even if attribute has required: false.
  Enable "--notablescan" MongoDB option on Circle CI.
  Add more missing indexes.
  Update mongodb args.
  Add method back.
  Inherit from uid mixin class.
  Add more missing indexes, remove unncessary get_uid method.
  Add more missing indexes.
  Update changelog.
  Add more missing indexes.
  Add some missing indexes which were found by running MongoDB with --notablescan option.
  Use latest stable version of MongoDB (3.2.14, 3.4.4) when running tests on Circle CI.
  Diable wired tiger statistics to speed up tests.
  ...

Conflicts:
	Makefile
@arm4b arm4b modified the milestones: 2.3.1, 2.3.0 Jun 13, 2017
@Kami Kami merged commit 08a2321 into StackStorm:master Jun 26, 2017
@cognifloyd cognifloyd removed the RFR label Aug 9, 2021
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.

4 participants