Skip to content

Commit

Permalink
Merge pull request #4795 from opsmill/stable
Browse files Browse the repository at this point in the history
Stable to Develop Mergeback
  • Loading branch information
dgarros authored Oct 31, 2024
2 parents 949596f + 2e89e34 commit be1ae13
Show file tree
Hide file tree
Showing 446 changed files with 8,568 additions and 9,364 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/welcome
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--------------------------------------------------------------------
********************************************************************

👋👋👋 Welcome to the Infrahub Demo Codespace environment 👋👋👋
👋👋👋 Welcome to the Infrahub Demo Codespaces environment 👋👋👋

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

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- develop
- stable
- release-*

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -116,7 +117,7 @@ jobs:
with:
submodules: true
- name: "Setup environment"
run: "pip install ruff==0.6.6"
run: "pip install ruff==0.7.1"
- name: "Linting: ruff check"
run: "ruff check . --exclude python_sdk"
- name: "Linting: ruff format"
Expand Down Expand Up @@ -734,7 +735,8 @@ jobs:
if: |
always() && !cancelled() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
!contains(needs.*.result, 'cancelled') &&
github.base_ref == 'develop'
runs-on:
group: huge-runners
steps:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.6
rev: v0.7.1
hooks:
# Run the linter.
- id: ruff
Expand Down
3 changes: 3 additions & 0 deletions .vale/styles/Infrahub/sentence-case.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ exceptions:
- JetStream
- Jinja
- Jinja2
- JWT
- Namespace
- NATS
- Node
Expand All @@ -63,9 +64,11 @@ exceptions:
- RFile
- SDK
- Single sign-on
- SSO
- TLS
- Tony Stark
- TransformPython
- UI
- Vale
- VS Code
- VS Code extensions
Expand Down
3 changes: 3 additions & 0 deletions .vale/styles/spelling-exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ APIs
artifact_definitions
artifact_name
async
Authentik
boolean
check_definitions
class_name
Expand Down Expand Up @@ -81,6 +82,7 @@ Newsfragment
Nornir
npm
o'brian
order_weight
openconfig
opentelemetry
order_by
Expand All @@ -95,6 +97,7 @@ REST
ressources
schema_mapping
sdk
subcommand
subnet
template_path
toml
Expand Down
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,64 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang

<!-- towncrier release notes start -->

## [1.0.0](https://github.com/opsmill/infrahub/tree/v1.0.0) - 2024-10-30

### Removed

- Remove previously deprecated GET API endpoint "/api/schema/" ([#3884](https://github.com/opsmill/infrahub/issues/3884))

### Deprecated

- Marked CoreAccount.role as deprecated
Due to the new permissions framework the account roles "admin" / "read-only" / "read-write" are deprecated and will be removed in Infrahub 1.1

### Added

- Reworked branch selector:
- Redesigned the UI
- Added filter for branch
- Improved accessibility & keyboard navigation
- Improved UX on new branch form
- Added quick link to view all branches
- Add support to sign in with OAuth2 and Open ID Connect (OIDC) ([#1568](https://github.com/opsmill/infrahub/issues/1568))
- Add internal HTTP adapter to allow for generic access from Infrahub ([#3302](https://github.com/opsmill/infrahub/issues/3302))
- Add support to search a node by human friendly ID within a GraphQL query ([#3908](https://github.com/opsmill/infrahub/issues/3908))
- Added link to our Discord server in the account menu
- Added permissions framework for global and object kind level permissions

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.
- New permissions system in UI:
- Implemented CRUD views for managing accounts, groups, roles, and permissions
- Updated all components to support new permission system
- Added dynamic message display according to user access levels

### Fixed

- 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))
- Add ability to import repositories with default branch other than 'main' ([#3435](https://github.com/opsmill/infrahub/issues/3435))
- Disable approve/merge/close buttons for merged Proposed Changes ([#3495](https://github.com/opsmill/infrahub/issues/3495))
- Fixed regex validation for List type attributes ([#3929](https://github.com/opsmill/infrahub/issues/3929))
- Allow users to run artifacts and generators on nodes without name attribute ([#4062](https://github.com/opsmill/infrahub/issues/4062))
- 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))
- "Retry All" button for checks is bigger ([#4315](https://github.com/opsmill/infrahub/issues/4315))
- Add a size restriction on common attribute kinds. Only TextArea and JSON support large values ([#4432](https://github.com/opsmill/infrahub/issues/4432))
- The HFID of a related node is properly returned via GraphQL in all scenarios ([#4482](https://github.com/opsmill/infrahub/issues/4482))
- Add full validation to BranchMerge and BranchRebase mutations ([#4595](https://github.com/opsmill/infrahub/issues/4595))
- Report user-friendly error for invalid uniqueness_constraints when loading schemas ([#4677](https://github.com/opsmill/infrahub/issues/4677))
- Fixed pagination query for nodes with order_by clause using non unique attributes ([#4700](https://github.com/opsmill/infrahub/issues/4700))
- Fixed schema migration when an attribute previously present on a node is added back ([#4727](https://github.com/opsmill/infrahub/issues/4727))
- Add order_weight property to multiple attributes and relationships in the demo schema to improve how some models are displayed in the list views
- Changed the Python SDK connection timeout to 60s
- Fix metric missing the query name in Prometheus data
- Fixes an issue where docker compose would output ANSI control characters that don't support it
- Prevent temporary directories generated by Docusaurus to be imported by Docker

## [0.16.4](https://github.com/opsmill/infrahub/tree/v0.16.4) - 2024-10-17

### Fixed

- 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))

## [0.16.3](https://github.com/opsmill/infrahub/tree/v0.16.3) - 2024-10-10

### Removed
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ Infrahub from [OpsMill](https://opsmill.com) is taking a new approach to Infrast

## Quick Start

> [!NOTE]
> 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.
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:

| No Data | Demo Data |
Expand Down
18 changes: 7 additions & 11 deletions backend/infrahub/api/artifact.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from fastapi import APIRouter, Body, Depends, Request, Response
from pydantic import BaseModel, Field

Expand All @@ -11,11 +9,9 @@
from infrahub.core.protocols import CoreArtifactDefinition
from infrahub.database import InfrahubDatabase # noqa: TCH001
from infrahub.exceptions import NodeNotFoundError
from infrahub.git.models import RequestArtifactDefinitionGenerate
from infrahub.log import get_logger
from infrahub.message_bus import messages

if TYPE_CHECKING:
from infrahub.services import InfrahubServices
from infrahub.workflows.catalogue import REQUEST_ARTIFACT_DEFINITION_GENERATE

log = get_logger()
router = APIRouter(prefix="/artifact")
Expand Down Expand Up @@ -68,9 +64,9 @@ async def generate_artifact(
branch=branch_params.branch,
)

service: InfrahubServices = request.app.state.service
await service.send(
message=messages.RequestArtifactDefinitionGenerate(
artifact_definition=artifact_definition.id, branch=branch_params.branch.name, limit=payload.nodes
)
service = request.app.state.service
model = RequestArtifactDefinitionGenerate(
artifact_definition=artifact_definition.id, branch=branch_params.branch.name, limit=payload.nodes
)

await service.workflow.submit_workflow(workflow=REQUEST_ARTIFACT_DEFINITION_GENERATE, parameters={"model": model})
9 changes: 3 additions & 6 deletions backend/infrahub/api/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from infrahub.core.branch import Branch # noqa: TCH001
from infrahub.core.protocols import CoreMenuItem
from infrahub.log import get_logger
from infrahub.menu.generator import generate_menu
from infrahub.menu.generator import generate_restricted_menu
from infrahub.menu.models import Menu # noqa: TCH001

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

menu_items = await registry.manager.query(
db=db, schema=CoreMenuItem, branch=branch
) # , prefetch_relationships=True)
menu = await generate_menu(db=db, branch=branch, account=account_session, menu_items=menu_items)

menu_items = await registry.manager.query(db=db, schema=CoreMenuItem, branch=branch)
menu = await generate_restricted_menu(db=db, branch=branch, account=account_session, menu_items=menu_items)
return menu.to_rest()
12 changes: 7 additions & 5 deletions backend/infrahub/api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,8 @@ async def load_schema(
for permission_backend in registry.permission_backends:
if not await permission_backend.has_permission(
db=db,
account_id=account_session.account_id,
account_session=account_session,
permission=GlobalPermission(
id="",
name="",
action=GlobalPermissions.MANAGE_SCHEMA.value,
decision=(
PermissionDecision.ALLOW_DEFAULT
Expand Down Expand Up @@ -333,7 +331,9 @@ async def load_schema(
migrations=result.migrations,
)
migration_error_msgs = await service.workflow.execute_workflow(
workflow=SCHEMA_APPLY_MIGRATION, expected_return=list[str], parameters={"message": apply_migration_data}
workflow=SCHEMA_APPLY_MIGRATION,
expected_return=list[str],
parameters={"message": apply_migration_data},
)

if migration_error_msgs:
Expand Down Expand Up @@ -381,7 +381,9 @@ async def check_schema(
constraints=result.constraints,
)
error_messages = await service.workflow.execute_workflow(
workflow=SCHEMA_VALIDATE_MIGRATION, expected_return=list[str], parameters={"message": validate_migration_data}
workflow=SCHEMA_VALIDATE_MIGRATION,
expected_return=list[str],
parameters={"message": validate_migration_data},
)
if error_messages:
raise SchemaNotValidError(message=",\n".join(error_messages))
Expand Down
8 changes: 7 additions & 1 deletion backend/infrahub/cli/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from infrahub.core.graph.index import node_indexes, rel_indexes
from infrahub.core.graph.schema import GRAPH_SCHEMA
from infrahub.core.initialization import (
create_anonymous_role,
create_default_menu,
create_default_roles,
create_super_administrator_role,
Expand Down Expand Up @@ -304,7 +305,9 @@ async def update_core_schema( # pylint: disable=too-many-statements
migrations=result.migrations,
)
migration_error_msgs = await service.workflow.execute_workflow(
workflow=SCHEMA_APPLY_MIGRATION, expected_return=list[str], parameters={"message": apply_migration_data}
workflow=SCHEMA_APPLY_MIGRATION,
expected_return=list[str],
parameters={"message": apply_migration_data},
)

if migration_error_msgs:
Expand Down Expand Up @@ -429,3 +432,6 @@ async def setup_permissions(db: InfrahubDatabase) -> None:
await create_super_administrators_group(db=db, role=administrator_role, admin_accounts=existing_accounts)

await create_default_roles(db=db)

if config.SETTINGS.main.allow_anonymous_access:
await create_anonymous_role(db=db)
Loading

0 comments on commit be1ae13

Please sign in to comment.