amoghrajesh commented on PR #54651:
URL: https://github.com/apache/airflow/pull/54651#issuecomment-3244091484
@potiuk @eladkal I might have a simple proposal here without too much
complexity. What if we add a simple coordination block at the top of provider
changelogs to store actionable information that release tooling can process
during the release?
In short this is what I propose, we define a block at the top of a
provider's changelog (since this will be mostly be per provider granularity)
### Format
```rst
# providers/common/messaging/docs/changelog.rst
.. COORDINATION-PENDING::
**Breaking Version:** 2.0.0
**Update Required:**
* apache-airflow-providers-amazon: ">=2.0.0"
* apache-airflow-providers-google: ">=2.0.0"
* apache-airflow-providers-azure: ">=2.0.0"
``apache-airflow-providers-common-messaging``
Changelog
---------
2.0.0
.....
```
### Workflow
1. Developer adds coordination block when introducing breaking changes
2. Tooling scans for `COORDINATION-PENDING` blocks during preparation
3. Tooling automatically updates affected provider dependencies
4. Block is removed/marked complete when coordination is done
### Potential Implementation
We will have to define some sort of parsing block to automatically updating
provider dependencies during release preparation.
Like define a python class like this --
Block:
```
class CoordinationRequirement:
breaking_version: str
affected_providers: Dict[str, str] # provider_name -> version_constraint
```
Parsing:
```
def parse_coordination_block(content: str) -> CoordinationRequirement:
# Find the coordination block
block_match = re.search(r'\.\.\ COORDINATION-PENDING::(.*?)(?=^\S|\Z)',
content, re.MULTILINE | re.DOTALL)
if not block_match:
return None
block_content = block_match.group(1)
version_match = re.search(r'\*\*Breaking Version:\*\*\s+(\S+)',
block_content)
if not version_match:
return None
breaking_version = version_match.group(1)
affected_providers = {}
provider_lines = re.findall(r'\*\s+([^:]+):\s+"([^"]+)"', block_content)
for provider, version_constraint in provider_lines:
clean_provider = provider.replace('apache-airflow-providers-',
'').strip()
affected_providers[clean_provider] = version_constraint
return CoordinationRequirement(
breaking_version=breaking_version,
affected_providers=affected_providers
)
```
Example:
```
content = """
.. COORDINATION-PENDING::
**Breaking Version:** 2.0.0
**Update Required:**
* apache-airflow-providers-amazon: ">=2.0.0"
* apache-airflow-providers-google: ">=2.0.0"
* apache-airflow-providers-azure: ">=2.0.0"
"""
req = parse_coordination_block(content)
# req.breaking_version = "2.0.0"
# req.affected_providers = {
# "amazon": ">=2.0.0",
# "google": ">=2.0.0",
# "azure": ">=2.0.0"
# }
req
Out[6]: CoordinationRequirement(breaking_version='2.0.0',
affected_providers={'* amazon': '>=2.0.0', 'google': '>=2.0.0', 'azure':
'>=2.0.0'})
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]