Skip to content

Commit

Permalink
Added a script to bump all integration + fix cre to have delete deps … (
Browse files Browse the repository at this point in the history
#191)

* Added a script to bump all integration + fix cre to have delete deps and create related true by default

* Bumped version
  • Loading branch information
danielsinai authored Oct 29, 2023
1 parent ed15ea7 commit 826695e
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.3.2 (2023-10-29)

### Improvements

- createMissingRelatedEntities + deleteDependentEntities are now defaulted to true


## 0.3.1 (2023-09-27)

### Bug Fixes
Expand Down
6 changes: 3 additions & 3 deletions port_ocean/clients/port/mixins/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def upsert_entity(
"upsert": "true",
"merge": str(request_options.get("merge", False)).lower(),
"create_missing_related_entities": str(
request_options.get("create_missing_related_entities", False)
request_options.get("create_missing_related_entities", True)
).lower(),
"validation_only": str(validation_only).lower(),
},
Expand Down Expand Up @@ -64,7 +64,7 @@ async def delete_entity(
headers=await self.auth.headers(user_agent_type),
params={
"delete_dependents": str(
request_options.get("delete_dependent_entities", False)
request_options.get("delete_dependent_entities", True)
).lower()
},
)
Expand Down Expand Up @@ -150,7 +150,7 @@ async def validate_entity_payload(
{
"merge": options.get("merge", False),
"create_missing_related_entities": options.get(
"create_missing_related_entities", False
"create_missing_related_entities", True
),
"validation_only": True,
},
Expand Down
4 changes: 2 additions & 2 deletions port_ocean/core/handlers/port_app_config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class ResourceConfig(BaseModel):
class PortAppConfig(BaseModel):
enable_merge_entity: bool = Field(alias="enableMergeEntity", default=False)
delete_dependent_entities: bool = Field(
alias="deleteDependentEntities", default=False
alias="deleteDependentEntities", default=True
)
create_missing_related_entities: bool = Field(
alias="createMissingRelatedEntities", default=False
alias="createMissingRelatedEntities", default=True
)
resources: list[ResourceConfig] = Field(default_factory=list)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.3.1"
version = "0.3.2"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
Expand Down
57 changes: 57 additions & 0 deletions scripts/bump-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

# Get the version argument from the command line
VERSION="$1"

if [ -z "$VERSION" ]; then
echo "Usage: $0 <version>"
exit 1
fi

# Loop through each folder in the 'integrations' directory
for folder in "$(pwd)"/integrations/*; do
if [ -d "$folder" ]; then
if [ ! -f "$folder"/pyproject.toml ]; then
continue
fi

echo "Bumping integration $folder"

echo "Run 'make install'"
(cd "$folder" && make install)

echo "Enter the Python virtual environment in the .venv folder"
(cd "$folder" && source .venv/bin/activate)

echo "Bump the version ocean version using Poetry"
(cd "$folder" && poetry add port-ocean@$VERSION -E cli)

echo "Run towncrier create"
(cd "$folder" && towncrier create --content "Bumped ocean version to $VERSION" 1.improvement.md)

echo "Run towncrier build"
current_version=$(poetry version --short)

echo "Current version: $current_version, updating patch version"
IFS='.' read -ra version_components <<< "$current_version"
major_version="${version_components[0]}"
minor_version="${version_components[1]}"
patch_version="${version_components[2]}"

((patch_version++))
new_version="$major_version.$minor_version.$patch_version"
echo "New version: $new_version"

poetry version "$new_version"

echo "New version: $NEW_VERSION"

echo "Run towncrier build to increment the patcb version"
(cd "$folder" && towncrier build --version $NEW_VERSION --yes)

echo "Run 'make install' again"
(cd "$folder" && make install)

deactivate
fi
done

0 comments on commit 826695e

Please sign in to comment.