Skip to content

Commit

Permalink
Merge branch 'develop' into subsub2
Browse files Browse the repository at this point in the history
  • Loading branch information
bflynn-cms authored Aug 28, 2024
2 parents 9b74b39 + 75ce829 commit a3911da
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Delete Topics
repo: cmsgov/cms-bigmac
repo: Enterprise-CMCS/bigmac
ref: refs/heads/master # OneMAC uses develop, bigmac uses master, dispatch assumes same name
token: ${{ secrets.BIGMAC_PERSONAL_ACCESS_TOKEN }}
inputs: '{ "topics": "mgmt.connect.stream-functions-${{ env.branch_name }}.offsets,mgmt.connect.stream-functions-${{ env.branch_name }}.config,mgmt.connect.stream-functions-${{ env.branch_name }}.status"}'
18 changes: 18 additions & 0 deletions destroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ do
echo `aws s3api delete-objects --bucket $x --delete "$(aws s3api list-object-versions --bucket $x --query='{Objects: DeleteMarkers[].{Key:Key,VersionId:VersionId}}')"`
#delete any unversioned files
echo `aws s3 rm s3://$x/ --recursive`
#turn off writes to bucket
echo 'Denying writes to bucket ' $x
echo `aws s3api put-bucket-policy --bucket $x --policy '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Principal": "*",
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::'"$x"'/*"
}
]
}'`
#force delete the bucket
echo 'Deleting bucket ' $x
echo `aws s3 rb s3://$x --force`
done
echo 'deleting stack: ' $i
echo `aws cloudformation delete-stack --stack-name $i`
Expand Down
10 changes: 9 additions & 1 deletion services/one-stream/package/buildAnyPackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const buildAnyPackage = async (packageId, config) => {
let showPackageOnDashboard = false;
let lmTimestamp = 0;
let adminChanges = [];
let packageInactivated = false;

result.Items.forEach((anEvent) => {
// we ignore all other v's (for now) and any email events
Expand Down Expand Up @@ -121,8 +122,10 @@ export const buildAnyPackage = async (packageId, config) => {
let eventConfig = {};

if (source === "OneMAC") {
if (anEvent?.currentStatus === Workflow.ONEMAC_STATUS.INACTIVATED)
if (anEvent?.currentStatus === Workflow.ONEMAC_STATUS.INACTIVATED) {
packageInactivated = true;
return;
}
showPackageOnDashboard = true;

if (anEvent.eventTimestamp > putParams.Item.lastActivityTimestamp) {
Expand Down Expand Up @@ -351,6 +354,11 @@ export const buildAnyPackage = async (packageId, config) => {
}
});

//if any submission has been inactivated then override package status
if (packageInactivated) {
putParams.Item.currentStatus = Workflow.ONEMAC_STATUS.INACTIVATED;
}

putParams.Item.lastEventTimestamp = lmTimestamp;
logIt(JSON.stringify(putParams));
await dynamoDb.put(putParams).promise();
Expand Down

0 comments on commit a3911da

Please sign in to comment.