repohistory icon indicating copy to clipboard operation
repohistory copied to clipboard

Data export

Open Henri-ColibrITD opened this issue 1 year ago • 18 comments

Love the project !

I would appreciate export options to use it in internal presentations, if you are open to contribution and don't have the time to work on that yourself, I'd be happy to help :)

Henri-ColibrITD avatar Apr 05 '24 10:04 Henri-ColibrITD

It would be great if you can work on this! However the Supabase part is current not tracked in the repository. I'll notify you after I set it up.

m4xshen avatar Apr 05 '24 13:04 m4xshen

@Henri-ColibrITD you can now begin setting up the project locally by following the instructions in CONTRIBUTING.md. Due to the use of GitHub Apps, the setup could appear complex. If you face any issue or the docs is not clear enough, feel free to ask for help!

m4xshen avatar Apr 06 '24 02:04 m4xshen

I was wondering, if we are confident the data pipeline (calling the github api to retrieve the repo stats, storing it in db, and getting the needed data from the db) works well, and if one is mainly working on UI stuff (as I would be I think), could I instead setup a "mock" local db like SQLite with a set of fake data, and hide it behind a "dev" flag or something like this ? (if you use an orm, it should be quite straight forward, but from what I see you use directly the supabase client ?)

Henri-ColibrITD avatar Apr 08 '24 09:04 Henri-ColibrITD

Yes I currently use the Supabase client directly. You can of course setup a mock db if that won't be too complicated for you.

m4xshen avatar Apr 16 '24 06:04 m4xshen

So, I went for the supabase route since adding a whole new abstraction layer for the db on top of supabase seemed too much work for a simply UI tweak (OK, there is a tiny bit more, but not that much). I believe I added the desired functionality, but I cannot for my life get the supabase anon key mentioned in https://github.com/repohistory/repohistory/blob/main/CONTRIBUTING.md

In case you are curious, my fork is available at https://github.com/Henri-ColibrITD/repohistory, but once I manage to fix this supabase thing, I'll do a pull request.

In CONTRIBUTING.md, you mention for the following

SUPABASE_ANON_KEY="anon key from step 5 output"

But since I did not get the key at step 5, I'm quite stuck (I searched for other means to retrieve this key, but without success for now). Do you know of another mean to retrieve it ? (In case you want to discuss this live, I could setup a meeting on the platform of your choice)

Henri-ColibrITD avatar Apr 25 '24 14:04 Henri-ColibrITD

For more information, here is what I should get according to docs:

Started supabase local development setup.

         API URL: http://localhost:54321
          DB URL: postgresql://postgres:postgres@localhost:54322/postgres
      Studio URL: http://localhost:54323
    Inbucket URL: http://localhost:54324
        anon key: eyJh......
service_role key: eyJh......

and here is what I get

Started supabase local development setup.

         API URL: http://127.0.0.1:65431
     GraphQL URL: http://127.0.0.1:65431/graphql/v1
          DB URL: postgresql://postgres:[email protected]:65432/postgres
      Studio URL: http://127.0.0.1:65433

Henri-ColibrITD avatar Apr 25 '24 14:04 Henri-ColibrITD

@Henri-ColibrITD Thanks for the detail information. You can fix the issue by enabling auth inside supabase/config.toml:

[auth]
enabled = true

and then restart the supabase client:

npx supabase stop
npx supabase start

Then you should see those two keys.

I misconfigured this file a few weeks ago. It should have been enabled originally. Sorry for the inconvenience.

m4xshen avatar Apr 26 '24 05:04 m4xshen

No problem, thanks for the quick reply! What about APP_PRIVATE_KEY ? It looks it should be a cryptographic key but I don't get which one

Henri-ColibrITD avatar Apr 26 '24 08:04 Henri-ColibrITD

That's the GitHub App private key. You should be able to generate one inside GitHub App settings.

m4xshen avatar Apr 26 '24 09:04 m4xshen

Ok, making progress on the setting up process: there seem to be a problem with the dependencies now:

Module not found: @nextui-org/system-rsc tried to access @nextui-org/theme (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.

Henri-ColibrITD avatar Apr 29 '24 12:04 Henri-ColibrITD

and for a more detailed error message: image

Henri-ColibrITD avatar Apr 29 '24 12:04 Henri-ColibrITD

@Henri-ColibrITD What package manager are you using? I personally use yarn. Maybe this affects the results.

m4xshen avatar Apr 30 '24 07:04 m4xshen

I noticed you're using yarn, so to minimize the differences between our two systems I used it too. It's the first time I use it (maybe explaining the noobie questions) so I might have misconfigured some parts.

Henri-ColibrITD avatar Apr 30 '24 11:04 Henri-ColibrITD

Did you run yarn to install the dependencies?

m4xshen avatar May 01 '24 12:05 m4xshen

I did! If I rerun it here is what I get:

$ yarn
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 270ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 925ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 1s 516ms

Henri-ColibrITD avatar May 01 '24 17:05 Henri-ColibrITD

I implemented the feature on a fork available here: https://github.com/Henri-ColibrITD/repohistory I could not test it but the feature is not groundbreaking so it shouldn't be too bad to review. I see two ways to move forward from there: either I manage to fix my environment problem or I can do a PR on a dev branch of your repo and you take back the lead on this feature. I'll try to fix my env and I'll keep you up to date

Henri-ColibrITD avatar Jun 11 '24 08:06 Henri-ColibrITD

Ok, by deleting everything (including the docker volumes and the repo itself), recloning the repo and reseting the yarn.lock file to its state when I initially forked the repo, I managed to make things work ! Now, I have the problem that, in src\utils\getLimit.ts

  const { data, error } = await supabase
    .from('users')
    .select('*')
    .eq('installation_id', installationId);

returns an empty list.

I installed the github app only on my fork of repohistory.

If I change getLimit to return a constant value, I have access to this repo, but then I have no data on the dashboard as you can see here: image

Do you know why this would happen ? (btw, if you don't want to pollute this feed, we can move this discussion to a private channel of you choice, just tell me :) )

Henri-ColibrITD avatar Jun 11 '24 13:06 Henri-ColibrITD

we can move this discussion to a private channel of you choice, just tell me :)

@Henri-ColibrITD Great I think we can discuss this in Discord! My username is m4xshen.

m4xshen avatar Jun 11 '24 13:06 m4xshen