Highlights
-
Add Chemical Method Fully Implemented & Tested
- A new
AddChemical
workflow to handle the creation of chemical entries, including CAS number validation and alias insertions. - A dedicated API endpoint (
/api/get-cas
) that checks the database for existing chemical records, reducing data duplication. - Enhanced error handling and user feedback for chemical creation and lookups.
- A new
-
Improved CAS Number Validation
- CAS validation logic has been relocated from
input-validators.js
to a dedicated module (cas-api.js
), ensuring cleaner separation of concerns and easier maintainability. - JavaScript validation checks and in-application checks help prevent invalid CAS entries.
- CAS validation logic has been relocated from
-
GitHub Actions & Workflow Updates
- Updated the GitHub Action (
.github/workflows/build-and-release.yml
) to automatically useTAG: "v2.3.0"
for consistent versioning in releases. - Streamlined binary release creation: the final artifact’s tag and name are automatically updated to the new version.
- Improved instructions for creating new Git tags and triggering the build using
gh api
.
- Updated the GitHub Action (
-
Documentation Enhancements
- README.md now includes clearer instructions for:
- Creating new tags and triggering binary compilation via GitHub Actions.
- Understanding the general usage flow of the Waste Tagging System.
- README.md now includes clearer instructions for:
-
Under-the-Hood Improvements
- New SQL scripts (
insert_chemical.sql
andinsert_alias.sql
) to handle chemical and alias insertions more reliably. - Code cleanup to reduce redundancy and improve overall system stability.
- New SQL scripts (
Detailed Changelog
Added
InsertNewChemical
Function
Inserts new chemical entries along with a corresponding alias into the database./api/get-cas
Endpoint
Checks if a chemical entry already exists by CAS number. Returns detailed JSON feedback on success or failure.
Changed
- GitHub Action (
build-and-release.yml
)- Now references an environment variable
TAG: "v2.3.0"
for versioning. - Updated release artifacts to use
name: ${{ env.TAG }}
andtag: ${{ env.TAG }}
.
- Now references an environment variable
- JavaScript CAS Validation
- Removed old CAS validation logic in
input-validators.js
and replaced it with the newcas-api.js
module for improved accuracy and maintainability.
- Removed old CAS validation logic in
README.md
- Added a new “Github Action” section with usage and tagging instructions.
- Updated usage flow details to reflect the new chemical-add workflow.
Fixed
- Minor bugs in CAS validation that previously allowed incorrect numbers to pass.
- Potential edge cases in adding a new chemical where aliases were not always inserted correctly.
Removed
- Redundant CAS validation logic from
input-validators.js
, superseded by the newcas-api.js
.
Upgrade Notes
- Pull the Latest Code: Ensure you have the latest
main
ormaster
branch which includes the new tags and updated workflows. - Use New Tagging Approach: Follow the updated instructions in the README for creating new tags and triggering binary builds via GitHub Actions.
- Check CAS-Related Logic: If you had custom CAS validation or used the old
input-validators.js
approach, update your references to the newcas-api.js
module.