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

Question - initial_value responder not identifying missing values as expected #18

Open
lwasser opened this issue Mar 15, 2024 · 5 comments
Labels
question Further information is requested

Comments

@lwasser
Copy link
Member

lwasser commented Mar 15, 2024

In the config file, i have this line: which i thought sets up an initial_Value responder

my understanding of that responder is that it will check to ensure there is a value in each of the with the following tags that is added to the responder config:
- version-submitted
- target-repository
- author-handle

i'm curious why it's not flagging the missing values when i create an issue.

the issue looks like this:

Submitting Author: <!--author-name--> <!--end-author-name--> (<!--author-handle--> <!--end-author-handle-->)
All current maintainers: (@github_handle1, @github_handle2)
Package Name: Package name here
One-Line Description of Package: Description here 
Repository Link:  <!--target-repository--> <!--end-target-repository-->
Version submitted: <!--version-submitted--> <!--end-version-submitted--> 
@lwasser lwasser changed the title Question - initial_value responder Question - initial_value responder not identifying missing values as expected Mar 15, 2024
@lwasser lwasser added the question Further information is requested label Mar 15, 2024
@lwasser
Copy link
Member Author

lwasser commented Mar 18, 2024

hey @xuanxu i'm still fighting with this responder.

ropensci has this

Sometimes warn_if_empty has a - before it and others it doesnt.

initial_values:
      if:
        value_matches:
          submission-type: "Standard|Estándar|Stats"
      values:
        # Below there is a list of items under author1 and each has a -
        - author1:
          - heading: Submitting Author
          - warn_if_empty: true
        - reviewers-list
        - repourl:
          - heading: Repository
          - warn_if_empty: true
         # Here there is a heading element and then warn_if_empty with no - before it. 
        - submission-type:
          - heading: Submission Type
            warn_if_empty: true
        - editor
        - language:
          - heading: Language Code
            warn_if_empty: true

for us it's not working at all . i tried adding warn_if_empty as the docs suggest that defaults to false. i've gone ahead and removed the - before warn_if_empty but again rOpenSci seems to use both approaches (see above).

    initial_values:
      values:
        - version-submitted
          warn_if_empty: true
        - target-repository
          warn_if_empty: true
        - author-handle
          warn_if_empty: true
    repo_checks:
      checks:
        - repo summary
        - languages

I also don't understand what heading does in this responder. i will update the docs once i understand how this should work and be configured. many thanks!

@xuanxu
Copy link
Member

xuanxu commented Mar 19, 2024

In your example the value names are missing a : at the end so it is not being parsed as a hash/dictionary, this should work:

initial_values:
  values:
    - version-submitted:
      - warn_if_empty: true
    - target-repository:
      - warn_if_empty: true
    - author-handle:
      - warn_if_empty: true

As for the ropensci code, I guess the case where they are missing the -is not working, but I'd have to check the code, maybe there's a failsafe for that case.

@xuanxu
Copy link
Member

xuanxu commented Mar 19, 2024

About the heading: it is used to configure the visible text to use if a value is missing and has to be created.
An example,
this:

initital_values:
  values:
    - author-handle
      - heading: Your Github Username 

Will add this:

Your Github Username: <!--author-handle--><!--end-author-handle-->

if you don't set the heading, the name of the value will be used:

Author handle: <!--author-handle--><!--end-author-handle-->

@lwasser
Copy link
Member Author

lwasser commented Mar 19, 2024

ok this makes sense. @xuanxu i suspect if i understood the syntax rules i'd ask you less questions 😆

So below you have provided me with this:

initial_values:
  values:
    - version-submitted:
      - warn_if_empty: true
    - target-repository:
      - warn_if_empty: true
    - author-handle:
      - warn_if_empty: true

how do i know when i need a - for an element. when i see a dash i think i'm creating a "list" or i think an "array" in this yaml? format?

so is the rule for the above that for the version-submitted key (in the hidden html comment), if i want to define settings for that key, i'd always need a : after the key like this:

  values:
    - version-submitted:
      - warn_if_empty: true

Is it true that - that colon : tells ruby that there are values to follow associated with that key value?

Next question:
do i always need the -?

example - is this valid:

  values:
    - version-submitted:
       warn_if_empty: true

Many thanks. i'm going to test this out now

@lwasser
Copy link
Member Author

lwasser commented Mar 19, 2024

ok it seems like that - is actually required. but i'd still love to understand the syntax rules around how each responder is configured.

it just reponded about missing values correctly here! yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants