Skip to content

Conversation

@cperal99
Copy link
Contributor

@cperal99 cperal99 commented Dec 4, 2025

Updated region parameter to allow retrieving feedin tariff

Updated region parameter to allow retrieving feedin tariff
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • If region = España is mandatory for feed-in tariffs, consider enforcing this via validation or conditional logic rather than relying solely on help text so users can’t accidentally select another region in that context.
  • You might want to clarify in the description/help how users know whether they are configuring a grid tariff vs a feed-in tariff (e.g., referencing the relevant parameter or mode), so the guidance on when to use España is unambiguous.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- If `region = España` is mandatory for feed-in tariffs, consider enforcing this via validation or conditional logic rather than relying solely on help text so users can’t accidentally select another region in that context.
- You might want to clarify in the description/help how users know whether they are configuring a grid tariff vs a feed-in tariff (e.g., referencing the relevant parameter or mode), so the guidance on when to use `España` is unambiguous.

## Individual Comments

### Comment 1
<location> `templates/definition/tariff/esios.yaml:27` </location>
<code_context>
   - name: region
     description:
-      generic: "Retrieve 1 out of 5 regions from the API."
+      generic: "Select 1 out of 5 regions for grid tariff. For feedin tariff always region = España"
     help:
-      en: Península, Canarias, Baleares, Ceuta, Melilla
</code_context>

<issue_to_address>
**question (bug_risk):** Wording implies a constraint that is not enforced by the schema itself.

The description introduces an invariant (feed-in tariffs must use `España`) that isn’t enforced by the schema, which still allows other regions. If other layers rely on this constraint, ensure it’s enforced (e.g., in validation/UI) or reword the description so it accurately matches the actual allowed values.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- name: region
description:
generic: "Retrieve 1 out of 5 regions from the API."
generic: "Select 1 out of 5 regions for grid tariff. For feedin tariff always region = España"
Copy link
Contributor

Choose a reason for hiding this comment

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

question (bug_risk): Wording implies a constraint that is not enforced by the schema itself.

The description introduces an invariant (feed-in tariffs must use España) that isn’t enforced by the schema, which still allows other regions. If other layers rely on this constraint, ensure it’s enforced (e.g., in validation/UI) or reword the description so it accurately matches the actual allowed values.

@andig
Copy link
Member

andig commented Dec 5, 2025

panic: processing template 'tariff/esios.yaml' failed: template 'esios-tariff-api': param region: description too long (84/50 allowed)- use help instead

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.

2 participants