Skip to content

Conversation

Borda
Copy link
Member

@Borda Borda commented Nov 6, 2022

What does this PR do?

reduce duplicated sections which are sensitive for human error and improve readability

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

@Borda Borda added the ci Continuous Integration label Nov 6, 2022
@Borda Borda added this to the v1.8.x milestone Nov 6, 2022
Copy link
Contributor

@akihironitta akihironitta left a comment

Choose a reason for hiding this comment

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

This will be very nice if it works!

Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

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

Blocking until I verify if this works! Thanks for the suggestion

@carmocca carmocca self-assigned this Nov 6, 2022
@Borda
Copy link
Member Author

Borda commented Nov 7, 2022

This will be very nice if it works!

in theory, it should, as it is using YAML native directive/syntax

BUT it seems that with this, the referred lists are loaded as sublists, so not expanded as a single flattened list :(

import yaml
from rich import print

with open(".github/checkgroup.yml") as fh:
    config = yaml.safe_load(fh)

print(config)

@carmocca
Copy link
Contributor

carmocca commented Nov 8, 2022

I checked and we use https://probot.github.io/api/7.0.1/classes/context.html#config to load the configuration file. There's no mention of any specific parsing constraints so I assume it will work just as yaml.safe_load()

Looking at https://stackoverflow.com/questions/24090177/how-to-merge-yaml-arrays, it looks like flattening these list is not possible.

The only solution I can think of is adding support for flattening in the javascript implementation of checkgroup so that we can use this notation: https://github.com/Lightning-AI/probot/blob/babecd77266ed8ac540de7f5e17804030174215c/src/check-group/utils/user_config_parser/populate_subprojects.ts#L63-L91

@carmocca carmocca removed their assignment Nov 8, 2022
@Borda
Copy link
Member Author

Borda commented Nov 8, 2022

The only solution I can think of is adding support for flattening in the javascript implementation of checkgroup

Let's keep it simple, personally, it may be good to be by default flatten all lists in check and paths as there is no meaning for a tree, but if it is not a few clicks away, let's drop it for now 🐰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants