Skip to content

Commit

Permalink
chore(src): sync changes between main and release
Browse files Browse the repository at this point in the history
  • Loading branch information
narekhovhannisyan committed Aug 9, 2024
1 parent 2fd2d62 commit dbfdaaf
Show file tree
Hide file tree
Showing 400 changed files with 21,742 additions and 8,035 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/dispatch-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Run if-check on requested branch

on:
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Run integration tests
run: npm run if-check -- -d manifests/outputs
64 changes: 63 additions & 1 deletion .github/workflows/nodejs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,83 @@ on: push
jobs:
build:
runs-on: ubuntu-latest
permissions:
pull-requests: write # this allows to show carbon and energy data table in PRs
steps:
- name: Eco CI Energy Estimation - Initialize
uses: green-coding-solutions/[email protected]

with:
task: start-measurement
continue-on-error: true

- name: Checkout code
uses: actions/checkout@v4

- name: Eco CI Energy Estimation - Get Measurement
uses: green-coding-solutions/[email protected]

with:
task: get-measurement
label: "checkout"
continue-on-error: true

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'

- name: Eco CI Energy Estimation - Get Measurement
uses: green-coding-solutions/[email protected]

with:
task: get-measurement
label: "setup node"
continue-on-error: true


- name: Install dependencies
run: npm install

- name: Eco CI Energy Estimation - Get Measurement
uses: green-coding-solutions/[email protected]

with:
task: get-measurement
label: "npm install"
continue-on-error: true


- name: Run lint
run: npm run lint

- name: Eco CI Energy Estimation - Get Measurement
uses: green-coding-solutions/[email protected]

with:
task: get-measurement
label: "npm run lint"
continue-on-error: true


- name: Run tests
- name: Run unit tests
run: npm run test --silent

- name: Eco CI Energy Estimation - Get Measurement
uses: green-coding-solutions/[email protected]

with:
task: get-measurement
label: "npm run test"
continue-on-error: true

- name: Eco CI Energy Estimation - End Measurement
uses: green-coding-solutions/[email protected]

with:
task: display-results
send-data: true
pr-comment: true
continue-on-error: true

38 changes: 37 additions & 1 deletion .github/workflows/release-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
PRE_RELEASE: ${{ github.event.release.prerelease}}

jobs:
release-commit-pr:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -28,6 +28,42 @@ jobs:
- name: Run unit tests
run: npm test

integration-tests:
runs-on: ubuntu-latest
needs: unit-tests
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm ci

- name: Run integration tests
run: npm run if-check -- -d manifests/outputs

publish:
runs-on: ubuntu-latest
needs: integration-tests
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm ci

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- name: Run unit tests
run: npm test

- name: Install dependencies
run: npm ci
- name: Run integration tests
run: npm run if-check -- -d manifests/outputs

- name: Initialize git user email
run: git config --global user.email "${{ env.RELEASE_USER_EMAIL }}"
Expand Down
12 changes: 7 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ The following document is a rule set of guidelines for contributing.
- [Naming conventions](#naming-conventions)
- [Documentation](#documentation)
- [Writing tests](#writing-tests)
- [How to report issues (bugs)](#how-to-report-issues-bugs)

## What and when to contribute

You can contribute anything to the IF, but we are likely to close out unsolicited PRs without merging them. Our issue board is completely open and we have tags (`help-wanted`, `good-first-issue`) to help contributors to choose tasks to work on. We recommend speaking to the core team on Github before starting working on an issue. You can do this by raising an issue or commenting on an existing issue. This helps us to direct your energy in directions that are aligned with our roadmap, prevent multiple people working on the same task, and better manage our board. This all makes it much more likely that your work will get merged.
You can contribute anything to the IF, but we are likely to close out unsolicited PRs without merging them. Our issue board is completely open and we have tags (`core-only`, `good-first-issue`) to help contributors to choose tasks to work on. If an issue is unassigned and does not have the `core-only` label, it is available to work on. We recommend speaking to the core team on Github before starting working on an issue. You can do this by commenting on an existing issue or discussion thread or starting a new one if appropriate. This helps us to direct your energy in directions that are aligned with our roadmap, prevent multiple people working on the same task, and better manage our board. This all makes it much more likely that your work will get merged.

You can also contribute by participating in discussions on our mailing list at [[email protected]](https://groups.google.com/u/1/a/greensoftware.foundation/g/if-community). We send out weekly updates that includes what we've shipped, what we're working on and how you can get involved each week.

## Reporting bugs

We appreciate bug reports! If you experience an issue with IF or one of our plugins, you can report it using our bug reporting template. To do this:
We appreciate bug reports! If you experience an issue with IF, you can report it using our bug reporting template. To do this:

1. Go to the [IF repository](https://github.com/Green-Software-Foundation/if) (or [plugin repository](https://github.com/Green-Software-Foundation/if-plugins) if you bug relates to a specific plugin)
1. Go to the [IF repository](https://github.com/Green-Software-Foundation/if)
2. Click on the `Issues` tab
3. Click on `Create New Issue` and select the `Bug Report` template.
4. Fill out the requested information.
Expand All @@ -43,8 +46,7 @@ The assessment rubric is as follows:
| | Consequence | Severity |
| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -------- |
| Bugs in IF core leading to incorrect calculations | unusable framework | 5 |
| Bugs in if-plugins leading to incorrect calculations | core pathways fail, IF very limited in functionality | 5 |
| Bugs in if-unofficial-pluginsd leading to incorrect calculations | Third party plugins harder to use, limits IF to standard lib | 3 |
| Bugs in builtins leading to incorrect calculations | core pathways fail, IF very limited in functionality | 5 |
| Bugs in template | Harder to build plugins, ecosystem growth is impacted | 2 |
| Bugs in docs | product does not match expectation, hard to debug, frustration, loss of adoption | 2 |
| Security flaw: privacy related | leak user data, unlikely to achieve adoption in serious orgs | 5 |
Expand Down
57 changes: 16 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
> [!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.
**Note** We have recently (March 2024) refactored the IF codebase and introduced some changes affecting both users and developers. You can read our migration guide [HERE](./Refactor-migration-guide.md) to help you update to the latest version!

[Impact Framework](https://greensoftwarefoundation.atlassian.net/wiki/spaces/~612dd45e45cd76006a84071a/pages/17072136/Opensource+Impact+Engine+Framework) (IF) is an [Incubation](https://oc.greensoftware.foundation/project-lifecycle.html#incubation) project from the [Open Source Working Group](https://greensoftwarefoundation.atlassian.net/wiki/spaces/~612dd45e45cd76006a84071a/pages/852049/Open+Source+Working+Group) in the [Green Software Foundation](https://greensoftware.foundation/).

**Our documentation is online at [if.greensoftware.foundation](https://if.greensoftware.foundation/)**

**IF** is a framework to **M**odel, **M**easure, si**M**ulate and **M**onitor the environmental impacts of software
Expand All @@ -23,68 +19,45 @@ Read the [specification and design docs](https://if.greensoftware.foundation) to

## Get started

The first thing to understand is that IF is a framework for running plugins. This means that in order to do some calculations, you need to load some plugins from some external resource. We provide a [standard library of plugins](https://github.com/Green-Software-Foundation/if-plugins) and a repository of [community plugins](https://github.com/Green-Software-Foundation/if-unofficial-plugins) to get you started.
IF is a framework for running pipelines of plugins that operate on a set of observations. This is all configured using a manifest file. We provide a standard library of plugins that come bundled with IF - we refer to these as `builtins`. We also have an [Explorer](https://explorer.if.greensoftware.foundation) where anyone can list third party plugins you can install.

Start by installing framework itself:
Start by installing the latest version of IF:

```sh
npm install -g "@grnsft/if"
```

Then installing some plugins:

```sh
npm install -g "@grnsft/if-plugins"
```

Then create a `manifest` file that describes your application (see our docs for a detailed explanation).

Then, run `if` using the following command:

```sh
ie --manifest <path-to-your-manifest-file>
## or you can use aliases
ie -m <path-to-your-manifest-file>
```

Note that above command will not print the final output. In order to print the final output to the console, run `if` using the optional stdout argument:
if-run --manifest <path-to-your-manifest-file>
## or you can use alias
if-run -m <path-to-your-manifest-file>

```sh
ie --manifest <path-to-your-manifest-file> --stdout
## or using aliases
ie -m <path-to-your-manifest-file> -s
```

You can also add a savepath for your output yaml in order to have the output stored in a file. Note that you also have to add configuration to your manifest to enable this, as follows:

```yaml
initialize:
output:
- yaml
```

On the command line:
Note that above command will print your outputs to the console. If you do not want to print the outputs to the console, you need to provide `--no-output` command. You can also provide the `--output` command to save your outputs to a yaml file:

```sh
ie --manifest <path-to-your-manifest-file> --output <your-savepath>
## or using aliases
ie -m <path-to-your-manifest-file> -o <your-savepath>
if-run -m <path-to-your-manifest> -o <savepath>
```

The `ie` CLI tool will configure and run the plugins defined in your input `yaml` (`manifest`) and return the results as an output `yaml` (`output`).
The `if-run` CLI tool will configure and run the plugins defined in your input `yaml` (`manifest`) and return the results as an output `yaml` (`output`).

Use the `debug` command if you want to diagnose and fix errors in your plugin:

```sh
ie --manifest <path-to-your-manifest-file> --debug
if-run --manifest <path-to-your-manifest-file> --debug
```

Use the `help` command if you need guidance about the available commands

```sh
ie --help
if-run --help
## or using alias
ie -h
if-run -h
```

## Documentation
Expand All @@ -97,16 +70,18 @@ Watch this video to learn how to create and run a `manifest`.

[![Watch the walk-through video](https://i3.ytimg.com/vi/R-6eDM8AsvY/maxresdefault.jpg)](https://youtu.be/GW37Qd4AQbU)

## Join our mailing list

We have a public mailing list at [[email protected]](https://groups.google.com/u/1/a/greensoftware.foundation/g/if-community). We send out weekly updates that explain what we've shipped, what we're working on and how you can get involved each week!

## Contributing

To contribute to IF, please fork this repository and raise a pull request from your fork.

You can check our issue board for issues tagged `help-wanted`. These are issues that are not currently, actively being worked on by the core team but are well-scoped enough for someone to pick up. We recommend commenting on the issue to start a chat with the core team, then start working on the issue when you have been assigned to it. This process helps to ensure your work is aligned with our roadmap and makes it much more likely that your changes will get merged compared to unsolicited PRs.
You can check our issue board for issues. We mark some issues `core-only` if they are somehow sensitive and we want one of our core developers to handle it. Any other issues are open for the community to work on. We recommend commenting on the issue to start a chat with the core team, then start working on the issue when you have been assigned to it. This process helps to ensure your work is aligned with our roadmap and makes it much more likely that your changes will get merged compared to unsolicited PRs.

Please read the full contribution guidelines at [if.greensoftware.foundation](https://if.greensoftware.foundation/Contributing)

The same guidelines also apply to `if-docs`, `if-plugins` and `if-unofficial-plugins`.

## Bug reports

To report bugs please use our bug report template. You can do this by opening a new issue and selecting `Bug Report` when you are prompted to pick a template. The more information you provide,.the quicker we will be able to reproduce, diagnose and triage your issue.
Expand Down
Loading

0 comments on commit dbfdaaf

Please sign in to comment.