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

Fix perl parser #960

Merged
merged 4 commits into from
Jun 6, 2022
Merged

Fix perl parser #960

merged 4 commits into from
Jun 6, 2022

Conversation

skilly-lily
Copy link
Contributor

@skilly-lily skilly-lily commented Jun 6, 2022

Overview

Given the following perl manifest META.yml file, we report an error when parsing the requires field:

name: Parse-Pidl
abstract: Generate parsers / DCE/RPC-clients from IDL
author:
    - Andrew Tridgell <tridge@samba.org>
    - Jelmer Vernooij <jelmer@samba.org>
    - Stefan Metzmacher <metze@samba.org>
    - Tim Potter <tpot@samba.org>
license: gplv3
installdirs:  site
homepage: http://www.samba.org/
bugtracker: http://bugzilla.samba.org/
requires:
    Parse::Yapp: 0    
recommends:
    Data::Dumper: 0
meta-spec:
    version: 1.3
    url: http://module-build.sourceforge.net/META-spec-v1.3.html

We expect the Parse::Yapp key (or any package name key) to have a textual version number, but here, it's an integer.
We have run into this before, and we use the TextLike data type for accepting any of text, integer, or double datatypes in JSON and YAML parsers, and forcing them to become text.

This PR uses the TextLike datatype for package version numbers in the perl analyzer.

Acceptance criteria

  • Test changes reflect the issue correctly
  • Tests continue to pass

Testing plan

Unit tests should be sufficient here.

Risks

None, the type system confirms that we have handled the text correctly until the transition point of TextLike -> Text, and the tests confirm the behavior is correct.

Reviewer, please validate the changes to the test files, and ensure that without these changes, the tests would fail.

References

ZD 4387

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).
  • If this PR introduced a user-visible change, I added documentation into docs/.
  • If this change is externally visible, I updated Changelog.md. If this PR did not mark a release, I added my changes into an # Unreleased section at the top.
  • If I made changes to .fossa.yml or fossa-deps.{json.yml}, I updated docs/references/files/*.schema.json. You may also need to update these if you have added/removed new dependency type (e.g. pip) or analysis target type (e.g. poetry).

@skilly-lily skilly-lily requested a review from a team as a code owner June 6, 2022 19:58
@skilly-lily skilly-lily enabled auto-merge (squash) June 6, 2022 20:05
@skilly-lily skilly-lily merged commit 7a52ae1 into master Jun 6, 2022
@skilly-lily skilly-lily deleted the fix-perl-parser branch June 6, 2022 20:25
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.

None yet

2 participants