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

Upload CSV to partner portal #96

Merged
merged 7 commits into from
Jun 17, 2024

Conversation

LDannijs
Copy link
Contributor

@LDannijs LDannijs commented Jun 3, 2024

Summary

Add a script, like the device repository, to sync the contents of this repo to Airtable so it can be used with the Partner Portal.

Changes

  • Add a script that converts all the templates into a csv
  • Update workflow to automate syncing to airtable

Notes for Reviewers

@benolayinka let me know if this seems correct.

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible, they don't break existing deployments.
  • Testing: The changes are tested.
  • Documentation: Relevant documentation is added or updated.

@github-actions github-actions bot added the needs/triage We still need to triage this label Jun 3, 2024
@LDannijs
Copy link
Contributor Author

LDannijs commented Jun 3, 2024

The CSV workflow is still giving an error now, but that is because there is no URL specified, so that has to be added after the PR is merged.

@LDannijs LDannijs requested a review from benolayinka June 3, 2024 09:38
@LDannijs LDannijs self-assigned this Jun 3, 2024
@LDannijs LDannijs requested review from KrishnaIyer and removed request for benolayinka and adriansmares June 12, 2024 08:17
Copy link
Member

@KrishnaIyer KrishnaIyer left a comment

Choose a reason for hiding this comment

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

The node_modules folder is not supposed to be checked in to version control. Please add that to .gitignore and delete it here.

Comment on lines 27 to 47
csv:
if: github.ref == 'refs/heads/master'
name: Upload CSV to Airtable
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Node.js dependencies
run: npm ci
- name: Create templates.csv
run: node bin/csv.js
- name: Upload to Airtable
run: |
curl -X POST ${{ secrets.AIRTABLE_WEBHOOKS_API_ENDPOINT }} \
-H "Authorization: Bearer ${{ secrets.AIRTABLE_WEBHOOKS_API_KEY }}" \
-H "Content-Type: text/csv" \
--data-binary "@bin/templates.csv"
Copy link
Member

Choose a reason for hiding this comment

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

Let's separate this out to a separate action. Ex: upload-to-airtable.yml and make that action run on a push to the master branch.

@LDannijs LDannijs requested a review from KrishnaIyer June 13, 2024 07:16
.github/workflows/upload-airtable.yml Outdated Show resolved Hide resolved
.github/workflows/validate.yml Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
bin/csv.js Show resolved Hide resolved
@LDannijs LDannijs requested a review from KrishnaIyer June 17, 2024 07:13
@KrishnaIyer KrishnaIyer removed the needs/triage We still need to triage this label Jun 17, 2024
Copy link
Member

@KrishnaIyer KrishnaIyer left a comment

Choose a reason for hiding this comment

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

I'm conditionally approving this out of necessity (as discussed on Slack). There are no tests to validate if csv.js file has all the correct fields. I trust that this is manually tested for now.

@KrishnaIyer KrishnaIyer merged commit 6882f08 into TheThingsNetwork:master Jun 17, 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.

2 participants