Skip to content

Commit

Permalink
Merge pull request #1113 from Green-Software-Foundation/release
Browse files Browse the repository at this point in the history
Sync Release with Main
  • Loading branch information
narekhovhannisyan authored Jan 13, 2025
2 parents d63b807 + 888ce18 commit a202ce7
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
ref: ${{ github.ref }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
ref: ${{ github.ref }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Node.js CI](https://github.com/Green-Software-Foundation/if/actions/workflows/nodejs-ci.yml/badge.svg)](https://github.com/Green-Software-Foundation/if/actions/workflows/nodejs-ci.yml)

> [!IMPORTANT]
> Incubation Project: This project is an incubation project being run inside the Green Software Foundation; as such, we DON’T recommend using it in any critical use case. Incubation projects are experimental, offer no support guarantee, have minimal governance and process, and may be retired at any moment. This project may one day Graduate, in which case this disclaimer will be removed.
> Graduated Project: This project is a Graduated Project, supported by the Green Software Foundation. The publicly available version documented in the README is trusted by the GSF. New versions of the project may be released, or it may move to the Maintained or Retired Stage at any moment.
**Our documentation is online at [if.greensoftware.foundation](https://if.greensoftware.foundation/)**

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@grnsft/if",
"description": "Impact Framework",
"version": "0.7.2",
"version": "1.0.0",
"author": {
"name": "Green Software Foundation",
"email": "[email protected]"
Expand Down
5 changes: 2 additions & 3 deletions src/common/config/strings.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
export const STRINGS = {
DISCLAIMER_MESSAGE: `
Incubation Project
Graduated Project
This project is an incubation project being run inside the Green Software Foundation; as such, we DON’T recommend using it in any critical use case.
Incubation projects are experimental, offer no support guarantee, have minimal governance and process, and may be retired at any moment. This project may one day graduate, in which case this disclaimer will be removed.`,
This project is a Graduated Project, supported by the Green Software Foundation. The publicly available version documented in the README is trusted by the GSF. New versions of the project may be released, or it may move to the Maintained or Retired Stage at any moment.`,
SOURCE_IS_NOT_YAML: 'Given source file is not in yaml format.',
TARGET_IS_NOT_YAML: 'Given target file is not in yaml format.',
MANIFEST_NOT_FOUND: 'Manifest file not found.',
Expand Down
15 changes: 3 additions & 12 deletions src/if-run/lib/compute.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {PluginParams} from '@grnsft/if-core/types';

import {Regroup} from './regroup';
import {isRegrouped, Regroup} from './regroup';
import {addExplainData} from './explain';

import {debugLogger} from '../../common/util/debug-logger';
Expand All @@ -23,7 +23,7 @@ const {
SKIPPING_REGROUP,
} = STRINGS;

const childNames = new Set();
const childNames = new Set<string>();

/**
* Traverses all child nodes based on children grouping.
Expand Down Expand Up @@ -147,16 +147,7 @@ const computeNode = async (node: Node, params: ComputeParams): Promise<any> => {
if ((noFlags || params.regroup) && pipelineCopy.regroup) {
const originalOutputs = params.append ? node.outputs || [] : [];

// Grabs all the values according to grouping criteria.
const regroupValues = pipelineCopy.regroup
.map(group => [...new Set(outputStorage.map(output => output[group]))])
.flat();
// Checks if regroup values are present in the children list.
const isRegrouped = regroupValues.every(one =>
[...childNames].includes(one)
);

if (!isRegrouped) {
if (!isRegrouped(pipelineCopy.regroup, outputStorage, childNames)) {
node.children = Regroup(
outputStorage,
originalOutputs,
Expand Down
17 changes: 17 additions & 0 deletions src/if-run/lib/regroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,20 @@ export const Regroup = (

return acc.children;
};

/**
* Grabs all the values according to grouping criteria, then
* checks if regroup values are present in the children list.
*/
export const isRegrouped = (
groups: string[],
outputStorage: PluginParams[],
childNames: Set<string>
) => {
const validatedGroups = validateGroups(groups);
const regroupValues = validatedGroups
.map(group => [...new Set(outputStorage.map(output => output[group]))])
.flat();

return regroupValues.every(one => [...childNames].includes(one));
};

0 comments on commit a202ce7

Please sign in to comment.