Skip to content

Commit

Permalink
Add integration tests, fix bug with release dates being required, add…
Browse files Browse the repository at this point in the history
… flexible dates to brassy release note date fields
  • Loading branch information
biosafetylvl5 committed Oct 14, 2024
1 parent c64806c commit b208ecb
Show file tree
Hide file tree
Showing 11 changed files with 808 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
integtest: mark a test as an integration test.
24 changes: 23 additions & 1 deletion src/brassy/templates/release_yaml_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from typing import List, Optional, Dict
from datetime import date as Date

import dateparser

from pydantic import (
BaseModel,
HttpUrl,
Expand All @@ -10,6 +12,7 @@
RootModel,
Field,
field_validator,
validator,
)


Expand Down Expand Up @@ -45,12 +48,31 @@ class DateRange(BaseModel):
start: Optional[Date]
finish: Optional[Date]

@validator("start", "finish", pre=True, always=True)
def parse_date(cls, value):
if value is None or isinstance(value, Date):
return value
if isinstance(value, str):
value = value.strip()
if not value or value.lower() in ["never", "null"]:
return None
try:
parsed = dateparser.parse(value)
if parsed is None:
raise ValueError(f"Unable to parse date string: {value}")
return parsed.date()
except Exception as e:
raise ValueError(f"Invalid date format: {value}") from e
raise ValueError(f"Invalid type for date field: {value}")


class ChangeItem(BaseModel):
title: str
description: str
files: Files
related_issue: Optional[RelatedIssue] = Field(alias="related-issue")
related_issue: Optional[RelatedIssue] = Field(
alias="related-issue", exclude_unset=True, default=None
)
date: Optional[DateRange] = None


Expand Down
6 changes: 6 additions & 0 deletions tests/inputs/barebones.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bug fix:
- title: Test bug fix.
description: 'This fixes all computer bugs ever written.'
files:
moved:
- linux/src
141 changes: 141 additions & 0 deletions tests/inputs/fully-featured.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
bug fix:
- title: "Fixed Aang's Avatar State Ⓐ"
description: |
Resolved an issue where Aang could not exit the Avatar State after consuming cactus juice. This caused unintended behavior and prevented progression in the story.
files:
deleted:
- ''
moved:
- 'src/characters/aang_temp.py:src/characters/aang.py'
added:
- ''
modified:
- 'src/avatar/avatar_state_manager.py'
related-issue:
number: 1001
repo_url: 'https://github.com/AvatarProject/AvatarRepo/issues/1001'
date:
start: '2023/01/01'
finish: '2023-01-05T23:59:59Z'

enhancement:
- title: 'Implemented Multi-Element Bending for Avatars'
description: |
Avatars can now bend multiple elements simultaneously, allowing for more complex combat strategies.
files:
deleted:
- ''
moved:
- ''
added:
- 'src/bending/multi_element.py'
modified:
- 'src/avatar/avatar_core.py'
- 'src/bending/bending_manager.py'
related-issue:
number: '1000000000000000000000000000000000000000000000'
repo_url: 'https://github.com/AvatarProject/AvatarRepo/issues/1000000000000000000000000000000000000000000000'
date:
start: '2023-03-01T00:00:00'
finish: '2023-03-10T23:59:59Z'

deprecation:
- title: 'Deprecated Old Bending Stances'
description: |
The classic bending stances are deprecated in favor of dynamic stances that adapt to the situation.
files:
deleted:
- ''
moved:
- ''
added:
- ''
modified:
- 'assets/animations/stances/*'
related-issue:
number: null
repo_url: ''
date:
start: 'Yesterday'
finish: 'Today'

removal:
- title: 'Removed Unagi Sea Serpent from Kyoshi Island'
description: |
The Unagi has been removed due to community feedback regarding difficulty levels.
files:
deleted:
- 'assets/creatures/unagi.obj'
- 'src/creatures/unagi_behavior.py'
moved:
- ''
added:
- ''
modified:
- 'src/locations/kyoshi_island.py'
related-issue:
number: '1005'
repo_url: 'https://github.com/AvatarProject/AvatarRepo/'
date:
start: '2023-05-01'
finish: 'Never'

performance:
- title: 'Optimized Fire Nation Ship Rendering'
description: |
Improved rendering performance for Fire Nation ships by 50% by reducing polygon count and optimizing textures.
files:
deleted:
- ''
moved:
- ''
added:
- ''
modified:
- 'assets/vehicles/fire_nation_ship.obj'
related-issue:
number: 1006
repo_url: 'https://github.com/AvatarProject/AvatarRepo/issues/1006'
date:
start: '2023-07-01'
finish: '2023-07-15'

documentation:
- title: 'Added Documentation for Combustion Bending'
description: |
New documentation explains the mechanics and limitations of combustion bending.
files:
deleted:
- ''
moved:
- ''
added:
- 'docs/bending/combustion_bending.md'
modified:
- ''
related-issue:
number: 1008
repo_url: 'https://github.com/AvatarProject/AvatarRepo/issues/1008'
date:
start: '2023-08-05'
finish: '2023-08-10'

continuous integration:
- title: 'Implemented Nightly Builds for the Fire Nation Branch'
description: |
Set up nightly builds and tests for the Fire Nation development branch to ensure stability.
files:
deleted:
- ''
moved:
- ''
added:
- '.github/workflows/nightly_fire_nation.yml'
modified:
- ''
related-issue:
number: 1009
repo_url: 'https://github.com/AvatarProject/AvatarRepo/issues/1009'
date:
start: '2023-09-01'
finish: '2023-09-02'
123 changes: 123 additions & 0 deletions tests/inputs/mostly-featured.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
bug fix:
- title: 'Fixed Bubble Blowing Glitch'
description: |
Resolved an issue where bubble shapes would not form correctly when using the Bubble Blowing Wand.
files:
deleted: []
moved: []
added: []
modified:
- 'src/bubble_wand.py'
related-issue:
number: 101
repo_url: 'https://github.com/spongebob-app/bubble-wand/issues/101'
date:
start: '2024-03-15'
finish: '2024-03-16'

enhancement:
- title: 'Added Krabby Patty Secret Formula Encryption'
description: |
Implemented advanced encryption for the Krabby Patty secret formula to enhance security.
files:
deleted: []
moved: []
added:
- 'src/secret_formula_encryption.py'
modified:
- 'src/krusty_krab_menu.py'
related-issue:
number: 202
repo_url: 'https://github.com/spongebob-app/krusty-krab/issues/202'
date:
start: '2024-04-01'
finish: '2024-04-10'

deprecation:
- title: 'Deprecated Old Jellyfish Net API'
description: |
The old Jellyfish Net API is now deprecated in favor of the new Electric Jellyfish Net API.
files:
deleted: []
moved: []
added: []
modified:
- 'src/jellyfish_net_v1.py'
related-issue:
number: 303
repo_url: 'https://github.com/spongebob-app/jellyfish-net/issues/303'
date:
start: '2024-05-01'
finish: '2024-05-05'

removal:
- title: 'Removed Rock Bottom Map Support'
description: |
Dropped support for the Rock Bottom map due to low user engagement and maintenance overhead.
files:
deleted:
- 'maps/rock_bottom_map.py'
moved: []
added: []
modified:
- 'src/map_loader.py'
related-issue:
number: 404
repo_url: 'https://github.com/spongebob-app/maps/issues/404'
date:
start: '2024-06-10'
finish: '2024-06-15'

performance:
- title: 'Optimized Patricks Rock Loading Time'
description: |
Improved the loading time for Patrick's Rock environment by 60% through asset optimization.
files:
deleted: []
moved: []
added: []
modified:
- 'assets/patricks_rock/*'
related-issue:
number: 505
repo_url: 'https://github.com/spongebob-app/environments/issues/505'
date:
start: '2024-07-01'
finish: '2024-07-05'

documentation:
- title: 'Updated Mermaid Man and Barnacle Boy Mission Logs'
description: |
Added new entries and corrected errors in the mission logs for better clarity and accuracy.
files:
deleted: []
moved: []
added:
- 'docs/mission_logs/mission_99.md'
modified:
- 'docs/mission_logs/index.md'
related-issue:
number: 606
repo_url: 'https://github.com/spongebob-app/docs/issues/606'
date:
start: '2024-08-01'
finish: '2024-08-02'

continuous integration:
- title: 'Implemented Jellyfish Fields CI/CD Pipeline'
description: |
Set up CI/CD pipeline using Jenkins for automated testing and deployment of the Jellyfish Fields module.
files:
deleted: []
moved: []
added:
- 'ci/jenkinsfile'
modified:
- 'ci/config.yml'
related-issue:
number: 707
repo_url: 'https://github.com/spongebob-app/ci/issues/707'
date:
start: '2024-09-01'
finish: '2024-09-03'

Loading

0 comments on commit b208ecb

Please sign in to comment.