You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "samcrang (via GitHub)" <gi...@apache.org> on 2023/03/16 17:44:39 UTC

[GitHub] [incubator-devlake] samcrang opened a new pull request, #4694: fix: add missing go struct tags

samcrang opened a new pull request, #4694:
URL: https://github.com/apache/incubator-devlake/pull/4694

   ### Summary
   Without this change doing:
   
   ```
   $ curl -X'PUT' -F 'file=@backend/plugins/dora/e2e/raw_tables/project_mapping.csv' 'http://localhost:8080/plugins/org/project_mapping.csv'
   ```
   
   Inserts the following into the DB (`SELECT * FROM project_mapping;`):
   
   ```
   
   project_name|table|row_id|created_at             |updated_at             |_raw_data_params|_raw_data_table|_raw_data_id|_raw_data_remark|
   ------------+-----+------+-----------------------+-----------------------+----------------+---------------+------------+----------------+
               |     |      |2023-03-16 17:27:12.826|2023-03-16 17:27:12.826|                |               |           0|                |
   ```
   
   With this change you get what you expect:
   
   ```
   project_name|table      |row_id|created_at             |updated_at             |_raw_data_params|_raw_data_table|_raw_data_id|_raw_data_remark|
   ------------+-----------+------+-----------------------+-----------------------+----------------+---------------+------------+----------------+
   project1    |boards     |board1|2023-03-16 17:29:33.942|2023-03-16 17:29:33.942|                |               |           0|                |
   project1    |boards     |board2|2023-03-16 17:29:33.942|2023-03-16 17:29:33.942|                |               |           0|                |
   project1    |cicd_scopes|cicd1 |2023-03-16 17:29:33.942|2023-03-16 17:29:33.942|                |               |           0|                |
   project1    |cicd_scopes|cicd2 |2023-03-16 17:29:33.942|2023-03-16 17:29:33.942|                |               |           0|                |
   project1    |repos      |repo1 |2023-03-16 17:29:33.942|2023-03-16 17:29:33.942|                |               |           0|                |
   project1    |repos      |repo2 |2023-03-16 17:29:33.942|2023-03-16 17:29:33.942|                |               |           0|                |
   project2    |boards     |board3|2023-03-16 17:29:33.942|2023-03-16 17:29:33.942|                |               |           0|                |
   project2    |cicd_scopes|cicd3 |2023-03-16 17:29:33.942|2023-03-16 17:29:33.942|                |               |           0|                |
   ```
   
   ### Does this close any open issues?
   N/A
   
   ### Screenshots
   N/A
   
   ### Other Information
   The other structs in this file `user`, `account` etc. will presumably also be broken. For some of those cases I wasn't sure what columns in the CSV maps to which field. For example, I wasn't sure what `user.TeamIds` should be when importing `backend/plugins/org/e2e/raw_tables/users.csv`. I've left this unchanged because it's not blocking me right now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] JoshuaPoddoku commented on pull request #4694: fix: add missing go struct tags

Posted by "JoshuaPoddoku (via GitHub)" <gi...@apache.org>.
JoshuaPoddoku commented on PR #4694:
URL: https://github.com/apache/incubator-devlake/pull/4694#issuecomment-1485758633

   Thank you for your contribution @samcrang and we want to issue you a certificate to honor your contribution on behalf of Apache DevLake! I will be reaching out to you on slack.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] samcrang commented on pull request #4694: fix: add missing go struct tags

Posted by "samcrang (via GitHub)" <gi...@apache.org>.
samcrang commented on PR #4694:
URL: https://github.com/apache/incubator-devlake/pull/4694#issuecomment-1475912287

   Ohhh, I see. I had assumed the files under `e2e` were examples of what the CSV should look like (ie snake cased headers). I couldn't understand how as implemented it was expected to work.
   
   This makes sense if it's expected that the CSV header is upper camel-cased.
   
   I think we can close this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud commented on pull request #4694: fix: add missing go struct tags

Posted by "mindlesscloud (via GitHub)" <gi...@apache.org>.
mindlesscloud commented on PR #4694:
URL: https://github.com/apache/incubator-devlake/pull/4694#issuecomment-1475317410

   Hi @samcrang, thanks for your insight and contribution, It's a good idea to keep the column names of the CSV file consistent with the database. However, maybe you already noticed, this would break the compatibility. Users have to modify their legacy CSV files before uploading them. If I had an opportunity to reimplement this feature, I would definitely adopt your approach, because it's so elegant and intuitive.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] samcrang closed pull request #4694: fix: add missing go struct tags

Posted by "samcrang (via GitHub)" <gi...@apache.org>.
samcrang closed pull request #4694: fix: add missing go struct tags
URL: https://github.com/apache/incubator-devlake/pull/4694


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org