Skip to content

Commit be1ae13

Browse files
authored
Merge pull request #4795 from opsmill/stable
Stable to Develop Mergeback
2 parents 949596f + 2e89e34 commit be1ae13

File tree

446 files changed

+8568
-9364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

446 files changed

+8568
-9364
lines changed

.devcontainer/welcome

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
--------------------------------------------------------------------
22
********************************************************************
33

4-
👋👋👋 Welcome to the Infrahub Demo Codespace environment 👋👋👋
4+
👋👋👋 Welcome to the Infrahub Demo Codespaces environment 👋👋👋
55

6-
The Infrahub API server, Git agents and dependent services have been
6+
The Infrahub API server, Task workers and dependent services have been
77
started. Infrahub can be accessed by opening the ports tab, clicking
88
on the globe icon in the Forwarded Address column of port 8000.
99

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches:
88
- develop
99
- stable
10+
- release-*
1011

1112
concurrency:
1213
group: ${{ github.workflow }}-${{ github.ref }}
@@ -116,7 +117,7 @@ jobs:
116117
with:
117118
submodules: true
118119
- name: "Setup environment"
119-
run: "pip install ruff==0.6.6"
120+
run: "pip install ruff==0.7.1"
120121
- name: "Linting: ruff check"
121122
run: "ruff check . --exclude python_sdk"
122123
- name: "Linting: ruff format"
@@ -734,7 +735,8 @@ jobs:
734735
if: |
735736
always() && !cancelled() &&
736737
!contains(needs.*.result, 'failure') &&
737-
!contains(needs.*.result, 'cancelled')
738+
!contains(needs.*.result, 'cancelled') &&
739+
github.base_ref == 'develop'
738740
runs-on:
739741
group: huge-runners
740742
steps:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313

1414
- repo: https://github.com/astral-sh/ruff-pre-commit
1515
# Ruff version.
16-
rev: v0.6.6
16+
rev: v0.7.1
1717
hooks:
1818
# Run the linter.
1919
- id: ruff

.vale/styles/Infrahub/sentence-case.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ exceptions:
4949
- JetStream
5050
- Jinja
5151
- Jinja2
52+
- JWT
5253
- Namespace
5354
- NATS
5455
- Node
@@ -63,9 +64,11 @@ exceptions:
6364
- RFile
6465
- SDK
6566
- Single sign-on
67+
- SSO
6668
- TLS
6769
- Tony Stark
6870
- TransformPython
71+
- UI
6972
- Vale
7073
- VS Code
7174
- VS Code extensions

.vale/styles/spelling-exceptions.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ APIs
44
artifact_definitions
55
artifact_name
66
async
7+
Authentik
78
boolean
89
check_definitions
910
class_name
@@ -81,6 +82,7 @@ Newsfragment
8182
Nornir
8283
npm
8384
o'brian
85+
order_weight
8486
openconfig
8587
opentelemetry
8688
order_by
@@ -95,6 +97,7 @@ REST
9597
ressources
9698
schema_mapping
9799
sdk
100+
subcommand
98101
subnet
99102
template_path
100103
toml

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,64 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang
1111

1212
<!-- towncrier release notes start -->
1313

14+
## [1.0.0](https://github.com/opsmill/infrahub/tree/v1.0.0) - 2024-10-30
15+
16+
### Removed
17+
18+
- Remove previously deprecated GET API endpoint "/api/schema/" ([#3884](https://github.com/opsmill/infrahub/issues/3884))
19+
20+
### Deprecated
21+
22+
- Marked CoreAccount.role as deprecated
23+
Due to the new permissions framework the account roles "admin" / "read-only" / "read-write" are deprecated and will be removed in Infrahub 1.1
24+
25+
### Added
26+
27+
- Reworked branch selector:
28+
- Redesigned the UI
29+
- Added filter for branch
30+
- Improved accessibility & keyboard navigation
31+
- Improved UX on new branch form
32+
- Added quick link to view all branches
33+
- Add support to sign in with OAuth2 and Open ID Connect (OIDC) ([#1568](https://github.com/opsmill/infrahub/issues/1568))
34+
- Add internal HTTP adapter to allow for generic access from Infrahub ([#3302](https://github.com/opsmill/infrahub/issues/3302))
35+
- Add support to search a node by human friendly ID within a GraphQL query ([#3908](https://github.com/opsmill/infrahub/issues/3908))
36+
- Added link to our Discord server in the account menu
37+
- Added permissions framework for global and object kind level permissions
38+
39+
In this first iteration the object permissions are applied to nodes as a whole, in upcoming versions it will be possible to define attribute level permissions as well.
40+
- New permissions system in UI:
41+
- Implemented CRUD views for managing accounts, groups, roles, and permissions
42+
- Updated all components to support new permission system
43+
- Added dynamic message display according to user access levels
44+
45+
### Fixed
46+
47+
- The `infrahub-git` agent service has been renamed to `task-worker` in docker compose and the command to start it has been updated as well ([#1075](https://github.com/opsmill/infrahub/issues/1075))
48+
- Add ability to import repositories with default branch other than 'main' ([#3435](https://github.com/opsmill/infrahub/issues/3435))
49+
- Disable approve/merge/close buttons for merged Proposed Changes ([#3495](https://github.com/opsmill/infrahub/issues/3495))
50+
- Fixed regex validation for List type attributes ([#3929](https://github.com/opsmill/infrahub/issues/3929))
51+
- Allow users to run artifacts and generators on nodes without name attribute ([#4062](https://github.com/opsmill/infrahub/issues/4062))
52+
- In the schema, properly delete inherited attribute and relationship on Node when the original attribute or relationship are being deleted on the Generic ([#4301](https://github.com/opsmill/infrahub/issues/4301))
53+
- "Retry All" button for checks is bigger ([#4315](https://github.com/opsmill/infrahub/issues/4315))
54+
- Add a size restriction on common attribute kinds. Only TextArea and JSON support large values ([#4432](https://github.com/opsmill/infrahub/issues/4432))
55+
- The HFID of a related node is properly returned via GraphQL in all scenarios ([#4482](https://github.com/opsmill/infrahub/issues/4482))
56+
- Add full validation to BranchMerge and BranchRebase mutations ([#4595](https://github.com/opsmill/infrahub/issues/4595))
57+
- Report user-friendly error for invalid uniqueness_constraints when loading schemas ([#4677](https://github.com/opsmill/infrahub/issues/4677))
58+
- Fixed pagination query for nodes with order_by clause using non unique attributes ([#4700](https://github.com/opsmill/infrahub/issues/4700))
59+
- Fixed schema migration when an attribute previously present on a node is added back ([#4727](https://github.com/opsmill/infrahub/issues/4727))
60+
- Add order_weight property to multiple attributes and relationships in the demo schema to improve how some models are displayed in the list views
61+
- Changed the Python SDK connection timeout to 60s
62+
- Fix metric missing the query name in Prometheus data
63+
- Fixes an issue where docker compose would output ANSI control characters that don't support it
64+
- Prevent temporary directories generated by Docusaurus to be imported by Docker
65+
66+
## [0.16.4](https://github.com/opsmill/infrahub/tree/v0.16.4) - 2024-10-17
67+
68+
### Fixed
69+
70+
- Fixed an issue on the UI where a new relationship was being added to the main branch instead of the current branch. ([#4598](https://github.com/opsmill/infrahub/issues/4598))
71+
1472
## [0.16.3](https://github.com/opsmill/infrahub/tree/v0.16.3) - 2024-10-10
1573

1674
### Removed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ Infrahub from [OpsMill](https://opsmill.com) is taking a new approach to Infrast
1010

1111
## Quick Start
1212

13-
> [!NOTE]
14-
> Infrahub is currently in beta, and the team is actively working towards reaching version 1.0 by the end of the year. The project is committed to ensuring data safety and providing a migration path for future releases. See our [FAQ](https://docs.infrahub.app/faq/) for more information.
15-
1613
Leveraging [GitHub Codespaces](https://docs.github.com/en/codespaces/overview), it's possible to start a new instance of Infrahub in the Cloud in minutes:
1714

1815
| No Data | Demo Data |

backend/infrahub/api/artifact.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING
4-
53
from fastapi import APIRouter, Body, Depends, Request, Response
64
from pydantic import BaseModel, Field
75

@@ -11,11 +9,9 @@
119
from infrahub.core.protocols import CoreArtifactDefinition
1210
from infrahub.database import InfrahubDatabase # noqa: TCH001
1311
from infrahub.exceptions import NodeNotFoundError
12+
from infrahub.git.models import RequestArtifactDefinitionGenerate
1413
from infrahub.log import get_logger
15-
from infrahub.message_bus import messages
16-
17-
if TYPE_CHECKING:
18-
from infrahub.services import InfrahubServices
14+
from infrahub.workflows.catalogue import REQUEST_ARTIFACT_DEFINITION_GENERATE
1915

2016
log = get_logger()
2117
router = APIRouter(prefix="/artifact")
@@ -68,9 +64,9 @@ async def generate_artifact(
6864
branch=branch_params.branch,
6965
)
7066

71-
service: InfrahubServices = request.app.state.service
72-
await service.send(
73-
message=messages.RequestArtifactDefinitionGenerate(
74-
artifact_definition=artifact_definition.id, branch=branch_params.branch.name, limit=payload.nodes
75-
)
67+
service = request.app.state.service
68+
model = RequestArtifactDefinitionGenerate(
69+
artifact_definition=artifact_definition.id, branch=branch_params.branch.name, limit=payload.nodes
7670
)
71+
72+
await service.workflow.submit_workflow(workflow=REQUEST_ARTIFACT_DEFINITION_GENERATE, parameters={"model": model})

backend/infrahub/api/menu.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from infrahub.core.branch import Branch # noqa: TCH001
1010
from infrahub.core.protocols import CoreMenuItem
1111
from infrahub.log import get_logger
12-
from infrahub.menu.generator import generate_menu
12+
from infrahub.menu.generator import generate_restricted_menu
1313
from infrahub.menu.models import Menu # noqa: TCH001
1414

1515
if TYPE_CHECKING:
@@ -29,9 +29,6 @@ async def get_menu(
2929
) -> Menu:
3030
log.info("menu_request", branch=branch.name)
3131

32-
menu_items = await registry.manager.query(
33-
db=db, schema=CoreMenuItem, branch=branch
34-
) # , prefetch_relationships=True)
35-
menu = await generate_menu(db=db, branch=branch, account=account_session, menu_items=menu_items)
36-
32+
menu_items = await registry.manager.query(db=db, schema=CoreMenuItem, branch=branch)
33+
menu = await generate_restricted_menu(db=db, branch=branch, account=account_session, menu_items=menu_items)
3734
return menu.to_rest()

backend/infrahub/api/schema.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,8 @@ async def load_schema(
247247
for permission_backend in registry.permission_backends:
248248
if not await permission_backend.has_permission(
249249
db=db,
250-
account_id=account_session.account_id,
250+
account_session=account_session,
251251
permission=GlobalPermission(
252-
id="",
253-
name="",
254252
action=GlobalPermissions.MANAGE_SCHEMA.value,
255253
decision=(
256254
PermissionDecision.ALLOW_DEFAULT
@@ -333,7 +331,9 @@ async def load_schema(
333331
migrations=result.migrations,
334332
)
335333
migration_error_msgs = await service.workflow.execute_workflow(
336-
workflow=SCHEMA_APPLY_MIGRATION, expected_return=list[str], parameters={"message": apply_migration_data}
334+
workflow=SCHEMA_APPLY_MIGRATION,
335+
expected_return=list[str],
336+
parameters={"message": apply_migration_data},
337337
)
338338

339339
if migration_error_msgs:
@@ -381,7 +381,9 @@ async def check_schema(
381381
constraints=result.constraints,
382382
)
383383
error_messages = await service.workflow.execute_workflow(
384-
workflow=SCHEMA_VALIDATE_MIGRATION, expected_return=list[str], parameters={"message": validate_migration_data}
384+
workflow=SCHEMA_VALIDATE_MIGRATION,
385+
expected_return=list[str],
386+
parameters={"message": validate_migration_data},
385387
)
386388
if error_messages:
387389
raise SchemaNotValidError(message=",\n".join(error_messages))

0 commit comments

Comments
 (0)