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

Failed to validate prescriptions for organization 1132719438 #22413

Open
fridex opened this issue Apr 25, 2022 · 7 comments
Open

Failed to validate prescriptions for organization 1132719438 #22413

fridex opened this issue Apr 25, 2022 · 7 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. sig/stack-guidance Categorizes an issue or PR as relevant to SIG Stack Guidance. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@fridex
Copy link
Contributor

fridex commented Apr 25, 2022

Describe the bug

2022-04-25 16:13:32,881 226484 WARNING  thoth.common:340: Logging to a Sentry instance is turned off
2022-04-25 16:13:32,882 226484 INFO     thoth.adviser:253: Version: 0.53.0
2022-04-25 16:13:32,883 226484 INFO     thoth.adviser:978: Validating prescriptions in '../prescriptions/prescriptions'
2022-04-25 16:13:32,883 226484 INFO     thoth.adviser.prescription.v1.prescription:334: Using prescriptions 'thoth' release 'dev+git'
2022-04-25 16:14:07,634 226484 ERROR    thoth.adviser.prescription.v1.prescription:199: Failed to validate schema for prescription: expected str for dictionary value @ data['units']['wraps'][0]['run']['release_notes']['organization']
Traceback (most recent call last):
  File "/home/fpokorny/git/thoth-station/adviser/thoth/adviser/prescription/v1/prescription.py", line 197, in from_dict
    PRESCRIPTION_SCHEMA(prescription)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected str for dictionary value @ data['units']['wraps'][0]['run']['release_notes']['organization']
2022-04-25 16:14:07,694 226484 ERROR    thoth.adviser.prescription.v1.prescription:302: Failed to load prescription from '../prescriptions/prescriptions/py_/pynvx/gh_release_notes.yaml'
2022-04-25 16:14:07,697 226484 CRITICAL root:105: Traceback (most recent call last):
  File "/home/fpokorny/git/thoth-station/adviser/thoth/adviser/prescription/v1/prescription.py", line 197, in from_dict
    PRESCRIPTION_SCHEMA(prescription)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected str for dictionary value @ data['units']['wraps'][0]['run']['release_notes']['organization']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./thoth-adviser", line 1011, in <module>
    __name__ == "__main__" and cli()
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "./thoth-adviser", line 979, in validate_prescription
    prescription = Prescription.validate(prescriptions)
  File "/home/fpokorny/git/thoth-station/adviser/thoth/adviser/prescription/v1/prescription.py", line 116, in validate
    prescription_instance = cls.load(prescriptions)
  File "/home/fpokorny/git/thoth-station/adviser/thoth/adviser/prescription/v1/prescription.py", line 295, in load
    prescription_instance = cls.from_dict(
  File "/home/fpokorny/git/thoth-station/adviser/thoth/adviser/prescription/v1/prescription.py", line 203, in from_dict
    raise PrescriptionSchemaError(str(exc))
thoth.adviser.exceptions.PrescriptionSchemaError: expected str for dictionary value @ data['units']['wraps'][0]['run']['release_notes']['organization']

run:
release_notes:
organization: 1132719438
repository: pynvx

To Reproduce
Steps to reproduce the behavior:

  1. Validate prescriptions
  2. See the error

Expected behavior

Prescription validation should succeed.

Additional context

We place organization into the prescription template here:

https://github.com/thoth-station/prescriptions-refresh-job/blob/ea21fa9056b16136ecbb8552ed26dde198fcacc8/thoth/prescriptions_refresh/handlers/gh_release_notes.py#L45

This means that the organization will be placed to the template and become an integer (instead of staying as a string):

       release_notes:
-        organization: 1132719438
+        organization: '1132719438'
@codificat
Copy link
Member

I believe this was fully addressed in thoth-station/prescriptions-refresh-job#148, so
/close
Please reopen if that was not the case

@sesheta
Copy link
Member

sesheta commented Apr 27, 2022

@codificat: Closing this issue.

In response to this:

I believe this was fully addressed in thoth-station/prescriptions-refresh-job#148, so
/close
Please reopen if that was not the case

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.

@sesheta sesheta closed this as completed Apr 27, 2022
@codificat
Copy link
Member

I did not understand the comments in thoth-station/prescriptions-refresh-job#148 correctly and merged it too soon, going to revert it, so
/reopen

@sesheta
Copy link
Member

sesheta commented Apr 27, 2022

@codificat: Reopened this issue.

In response to this:

I did not understand the comments in thoth-station/prescriptions-refresh-job#148 correctly and merged it too soon, going to revert it, so
/reopen

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.

@codificat
Copy link
Member

@mayaCostantini I reverted the changes from merging your previous PR too soon - apologies again for that.

/sig stack-guidance

and I'll add (feel free to adjust):
/priority important-soon
/triage accepted

@sesheta sesheta added sig/stack-guidance Categorizes an issue or PR as relevant to SIG Stack Guidance. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Apr 27, 2022
@sesheta
Copy link
Member

sesheta commented Jul 26, 2022

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@sesheta sesheta added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 26, 2022
@codificat
Copy link
Member

/remove-lifecycle stale

@codificat codificat removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 8, 2022
@codificat codificat added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. and removed priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. sig/stack-guidance Categorizes an issue or PR as relevant to SIG Stack Guidance. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants