Skip to content

Commit

Permalink
Merge branch 'main' into 950_export_collaboration_level
Browse files Browse the repository at this point in the history
  • Loading branch information
TanyaStere42 committed Jan 29, 2024
2 parents c09ca0f + 8e393d0 commit 86fff64
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 69 deletions.
89 changes: 23 additions & 66 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
name: Docker

on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- v*
schedule:
- cron: '0 16 * * *' # Every day at 16:00 UTC (~09:00 PT)
on: [pull_request, workflow_dispatch]
# schedule:
# - cron: '0 16 * * *' # Every day at 16:00 UTC (~09:00 PT)

jobs:
# Push container image to GitHub Packages and Docker Hub.
# See also https://docs.docker.com/docker-hub/builds/
deploy:
if: github.event.pull_request.head.repo.full_name == github.repository
name: Docker image build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
if: github.event_name == 'schedule'
with:
submodules: true
ref: main
# - uses: actions/checkout@v2
# if: github.event_name == 'schedule'
# with:
# submodules: true
# ref: main

- uses: actions/checkout@v2
if: github.event_name != 'schedule'
# if: github.event_name != 'schedule'
with:
submodules: true

Expand All @@ -51,11 +44,11 @@ jobs:
./scripts/codex/buildx.sh
# Log into container registries
- name: Login to DockerHub
uses: docker/login-action@v1
- name: Docker Login
uses: docker/login-action@v3.0.0
with:
username: wildmeorg
password: ${{ secrets.WBIA_WILDMEBOT_DOCKER_HUB_TOKEN }}
username: ${{ secrets.DOCKER_USER_SECRET }}
password: ${{ secrets.DOCKER_TOKEN_SECRET }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
Expand All @@ -81,56 +74,20 @@ jobs:
# Push bleeding-edge image (main tag) to registries
- name: Bleeding Edge Docker Hub
if: github.ref == 'refs/heads/main'
run: |
./scripts/utils/buildx.docker.sh -t main
- name: Bleeding Edge GHCR
if: github.ref == 'refs/heads/main'
run: |
./scripts/utils/buildx.docker.sh -t main -r ghcr.io/wildmeorg/houston
# Push nightly image (nightly tag) to registries
- name: Nightly Docker Hub
if: github.event_name == 'schedule'
run: |
./scripts/utils/buildx.docker.sh -t nightly
- name: Nightly GHCR
if: github.event_name == 'schedule'
run: |
./scripts/utils/buildx.docker.sh -t nightly -r ghcr.io/wildmeorg/houston
# Notify status in Slack
- name: Slack Notification
if: ${{ failure() && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_CHANNEL: dev-houston
SLACK_COLOR: '#FF0000'
SLACK_ICON: https://avatars.slack-edge.com/2020-03-02/965719891842_db87aa21ccb61076f236_44.png
SLACK_MESSAGE: 'Tagged / Latest Docker build of Houston failed :sob:'
SLACK_USERNAME: "GitHub CI"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

- name: Slack Notification
if: ${{ failure() && github.ref == 'refs/heads/main' }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_CHANNEL: dev-houston
SLACK_COLOR: '#FF0000'
SLACK_ICON: https://avatars.slack-edge.com/2020-03-02/965719891842_db87aa21ccb61076f236_44.png
SLACK_MESSAGE: 'Bleeding Edge Docker build of Houston failed :sob:'
SLACK_USERNAME: "GitHub CI"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

- name: Slack Notification
if: ${{ failure() && github.event_name == 'schedule' }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_CHANNEL: dev-houston
SLACK_COLOR: '#FF0000'
SLACK_ICON: https://avatars.slack-edge.com/2020-03-02/965719891842_db87aa21ccb61076f236_44.png
SLACK_MESSAGE: 'Nightly Docker build of Houston failed :sob:'
SLACK_USERNAME: "GitHub CI"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
#- name: Nightly Docker Hub
# if: github.event_name == 'schedule'
# run: |
# ./scripts/utils/buildx.docker.sh -t nightly

#- name: Nightly GHCR
# if: github.event_name == 'schedule'
# run: |
# ./scripts/utils/buildx.docker.sh -t nightly -r ghcr.io/wildmeorg/houston
2 changes: 1 addition & 1 deletion _frontend.codex
Submodule _frontend.codex updated 31 files
+20 −1 locale/en.json
+1 −1 src/components/AuthenticatedAppHeader/NotificationsPane.jsx
+118 −118 src/components/EditUserMetadata.jsx
+156 −158 src/components/PreferenceModal.jsx
+2 −2 src/components/RequestCollaborationButton.jsx
+24 −18 src/components/UserProfile.jsx
+18 −0 src/components/cards/MyCollaborationsCard.jsx
+40 −8 src/components/cards/collaborations/CollaborationsDialog.jsx
+73 −10 src/components/cards/collaborations/collaborationStates.js
+3 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationApprovedDialog.jsx
+3 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationEditApprovedDialog.jsx
+4 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationEditRequestDialog.jsx
+66 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationExportApprovedDialog.jsx
+30 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationExportDeniedDialog.jsx
+85 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationExportRequestDialog.jsx
+30 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationExportRevokeDialog.jsx
+30 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationManagerExportApprovedDialog.jsx
+31 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationManagerExportDeniedDialog.jsx
+30 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationManagerExportRevokeDialog.jsx
+4 −0 src/components/dialogs/notificationDialogUtils/NotificationCollaborationRequestDialog.jsx
+21 −0 src/components/dialogs/notificationDialogUtils/index.js
+105 −12 src/constants/notificationSchema.js
+10 −0 src/models/collaboration/useRequestExportAccess.js
+9 −0 src/pages/dataPage/DataPage.jsx
+0 −1 src/pages/fieldManagement/settings/DefaultFieldTable.jsx
+2 −0 src/pages/home/Home.jsx
+2 −0 src/pages/user/User.jsx
+0 −1 src/pages/userManagement/components/CollaborationManagementForm.jsx
+39 −1 src/pages/userManagement/components/EditCollaborationDialog.jsx
+1 −0 src/pages/userManagement/constants/collaboration.js
+22 −1 src/utils/collaborationUtils.js
4 changes: 3 additions & 1 deletion app/modules/annotations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class AnnotationKeywords(db.Model, HoustonModel):
annotation_guid = db.Column(
db.GUID, db.ForeignKey('annotation.guid'), primary_key=True
)
keyword_guid = db.Column(db.GUID, db.ForeignKey('keyword.guid'), primary_key=True)
keyword_guid = db.Column(
db.GUID, db.ForeignKey('keyword.guid', ondelete='CASCADE'), primary_key=True
)
annotation = db.relationship('Annotation', back_populates='keyword_refs')
keyword = db.relationship('Keyword')

Expand Down
4 changes: 3 additions & 1 deletion app/modules/assets/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

class AssetTags(db.Model, HoustonModel):
asset_guid = db.Column(db.GUID, db.ForeignKey('asset.guid'), primary_key=True)
tag_guid = db.Column(db.GUID, db.ForeignKey('keyword.guid'), primary_key=True)
tag_guid = db.Column(
db.GUID, db.ForeignKey('keyword.guid', ondelete='CASCADE'), primary_key=True
)
asset = db.relationship('Asset', back_populates='tag_refs')
tag = db.relationship('Keyword')

Expand Down
1 change: 1 addition & 0 deletions app/modules/users/permissions/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
'is_admin',
],
('Keyword', AccessOperation.READ): ['is_active'],
('Keyword', AccessOperation.DELETE): ['is_admin'],
('Sighting', AccessOperation.WRITE_INTERNAL): ['is_internal'],
('Sighting', AccessOperation.READ_PRIVILEGED): ['is_staff'],
('Sighting', AccessOperation.READ): ['is_admin'],
Expand Down
73 changes: 73 additions & 0 deletions migrations/versions/dc91b517a7a4_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# -*- coding: utf-8 -*-
"""empty message
Revision ID: dc91b517a7a4
Revises: 53b0fec87272
Create Date: 2024-01-22 22:51:34.690766
"""

from alembic import op

# revision identifiers, used by Alembic.
revision = 'dc91b517a7a4'
down_revision = '53b0fec87272'


def upgrade():
"""
Upgrade Semantic Description:
ENTER DESCRIPTION HERE
"""
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('annotation_keywords', schema=None) as batch_op:
batch_op.drop_constraint(
'fk_annotation_keywords_keyword_guid_keyword', type_='foreignkey'
)
batch_op.create_foreign_key(
batch_op.f('fk_annotation_keywords_keyword_guid_keyword'),
'keyword',
['keyword_guid'],
['guid'],
ondelete='CASCADE',
)

with op.batch_alter_table('asset_tags', schema=None) as batch_op:
batch_op.drop_constraint('fk_asset_tags_tag_guid_keyword', type_='foreignkey')
batch_op.create_foreign_key(
batch_op.f('fk_asset_tags_tag_guid_keyword'),
'keyword',
['tag_guid'],
['guid'],
ondelete='CASCADE',
)

# ### end Alembic commands ###


def downgrade():
"""
Downgrade Semantic Description:
ENTER DESCRIPTION HERE
"""
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('asset_tags', schema=None) as batch_op:
batch_op.drop_constraint(
batch_op.f('fk_asset_tags_tag_guid_keyword'), type_='foreignkey'
)
batch_op.create_foreign_key(
'fk_asset_tags_tag_guid_keyword', 'keyword', ['tag_guid'], ['guid']
)

with op.batch_alter_table('annotation_keywords', schema=None) as batch_op:
batch_op.drop_constraint(
batch_op.f('fk_annotation_keywords_keyword_guid_keyword'), type_='foreignkey'
)
batch_op.create_foreign_key(
'fk_annotation_keywords_keyword_guid_keyword',
'keyword',
['keyword_guid'],
['guid'],
)

# ### end Alembic commands ###

0 comments on commit 86fff64

Please sign in to comment.