Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleaned up env.js #1080

Merged
merged 11 commits into from
Apr 9, 2024
Merged

cleaned up env.js #1080

merged 11 commits into from
Apr 9, 2024

Conversation

majesticio
Copy link
Contributor

cleaned up env.js and removed knexfile Dockerfile and associated docs

@majesticio majesticio requested a review from russbiggs February 8, 2024 23:49
Copy link

github-actions bot commented Feb 8, 2024

results:
There are 1 unused packages:

⚠⚠⚠⚠⚠⚠⚠⚠⚠
Unused dependencies:
- knex

@majesticio
Copy link
Contributor Author

I am going to remove the unused dependency (knex)

Copy link
Member

@russbiggs russbiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still some questionable variables in the code. Also the documentation in the README.md need to be updated to reflect all the changes here: https://github.com/openaq/openaq-fetch/blob/main/README.md#installing--running

and here

https://github.com/openaq/openaq-fetch/blob/main/docs/env.md

I'm also curious how index.adapter.sh, index.sh, run-script.js, docker-compose.yml are used if at all. If not used they need to be removed as well.

Is anything is data_scripts being run with the new process? they seem like most legacy adapters.

src/lib/env.js Outdated
* @param {string} psqlPassword
* @param {string} psqlDatabase
* @param {number} psqlPoolMin
* @param {number} psqlPoolMax
* @param {string} apiURL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont believe fetch communicates with the API any more, this and any functionality that is using this is likely stale, re-review this usage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API_URL is used in deploy.yml for GH secrets

src/lib/env.js Outdated
* @param {string} psqlPassword
* @param {string} psqlDatabase
* @param {number} psqlPoolMin
* @param {number} psqlPoolMax
* @param {string} apiURL
* @param {string} webhookKey
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using the webhook still? I dont believe so. This an its usage needs to be reviewed and removed if needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webhook key is being called by fetch.js, which in turn is being called by index.js

src/lib/env.js Outdated
@@ -181,13 +174,6 @@ export default () => {
const maxParallelAdapters = +_env.MAX_PARALLEL_ADAPTERS || 1024;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still relevant now thats its on lambda? seems like something from the container version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maxParallelAdapters is being used in fetch.js and is included in our .env files

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to say - the impression that i get is that it will default to 2x the cores based on the documentation for the python version. It was set to 1 in production though.

@majesticio
Copy link
Contributor Author

I have removed all of the unused files, I need to investigate the use of API_URL in deploy.yml to fetch GH secrets

@russbiggs
Copy link
Member

I have removed all of the unused files, I need to investigate the use of API_URL in deploy.yml to fetch GH secrets

Ignore anything in github action. All this clean up is agnostic of whats happning in Github Actions

@caparker
Copy link
Collaborator

@majesticio Where are we standing on this branch?

@majesticio
Copy link
Contributor Author

This should be good to go, but I will need to adjust it to accommodate our recent changes

@russbiggs
Copy link
Member

My comments were never addressed re:API_URL and WEBHOOK_KEY These are not actively used and need to be cleaned up

@majesticio
Copy link
Contributor Author

I will get those taken care of.

@majesticio
Copy link
Contributor Author

API_URL and WEBHOOK_KEY have been removed and merge conflicts with main resolved.

Copy link
Collaborator

@caparker caparker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks good. Just need to fix that function in the notifications.js file that I commented.

src/lib/notification.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@caparker caparker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one does not seem ready. I ran it locally and it did not finish and because there are so many changes it makes me nervous to merge it into main.

Could you (@majesticio) run it locally and compare it to a local run on the main branch and let me konw what you think?

@majesticio
Copy link
Contributor Author

@caparker it ran identically for me, and finished a few seconds faster. I am concerned if it does not work on your end

@caparker
Copy link
Collaborator

caparker commented Mar 22, 2024 via email

@caparker caparker merged commit 53b9640 into main Apr 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants