Skip to content

(all-in-one); latest: Inspect argument for start-up#57

Open
comfy-home wants to merge 13 commits intoTheCarBun:mainfrom
comfy-home:inspect-argument-for-startup
Open

(all-in-one); latest: Inspect argument for start-up#57
comfy-home wants to merge 13 commits intoTheCarBun:mainfrom
comfy-home:inspect-argument-for-startup

Conversation

@comfy-home
Copy link
Copy Markdown
Contributor

Here is the whole chunk, also with -- inspect argument we discussed in #55

Supported start-up arguments:

streamlit run app.py

  • checks your own stats (backend passes your creds from secrets.toml)

streamlit run app.py -- inspect

  • start server in inspect mode, so user can view stats of any GitHub user. It's not auto-opened in default browser

streamlit run app.py --server.headless false -- inspect

  • opens dashboard in default browser in inspect mode, so user can view stats of any GitHub user

---

* Token parsed automatically, and user name pre-filled.

* add `username = "your-git-username"` to secrets.toml
fix: correct contribution count calculation in process_contribution_data
---

start-up commands:

`streamlit run app.py`
* checks your own stats (backend passes your creds from secrets.toml)

`streamlit run app.py -- inspect`
* start server in inspect mode, so user can view stats of any GitHub user. It's not auto-opened in default browser

`streamlit run app.py --server.headless false -- inspect`
* opens dashboard in default browser in inspect mode, so user can view stats of any GitHub user
Copy link
Copy Markdown
Owner

@TheCarBun TheCarBun left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

Comment thread utils/streamlit_ui.py
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

wait, I approved this but needed some changes.
when ran with an argument(--inspect in this case) it should open user's own github stats.

running it normally with streamlit run app.py should show the normal deployed version.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hey CarBun!

Are you sure you want it that way? I can do it, but TBH, it doesn't make too much sense... let me explain...

If we leave it as is, and -- inspect is used only by your deployed version on git-stats.streamlit.app/ then:

  • it's much easier on end-user (no argument needed - only your deployed version needs it)
  • end-user can run simply via streamlit run app.py and they can view their stats as soon as they visit their frontend, page refresh is working, etc
  • end user can still view stats of other users if they change name in side-panel

IMO, it's much more user-friendly as it is, and it can be communicated in readme much simpler because:

  • if someone clones the repo, I'd say there is 99% chance that they will use it primarily to monitor their progress, not someone elses
  • you can just add to readme a line that says "run with -- inspect if you want to mimic website's behaviour"

Anyways..., I've made that change as a separate PR, so you can choose either this one (#57), or the other one (#59) - you can discard unused one...

Have a great day

T

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you so much for making 2 different prs with alternate changes. I really appreciate it!!
I understand it will be easier for the end user to use it like that but I'm not sure if I'll be able to add an argument during deployment on streamlit cloud.
I don't remember the exact options so I checked the web to see if that's possible but I couldn't find anything about deployment where I can add the start command or any arguments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No prob. You're welcome.

Frankly, I thought that this must be the reason. I totally understand - there are several services I used just few times, and when I need to change something within my code once in a while, I'm all anxious because
A) I don't remember the workflow of the service
B) it's several versions ahead now

... so I can relate 👍

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I cannot understand which one to merge for the inspect feature. How do I check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

or


To sum it up:

  • in 57:
    • self-hosted version is run via streamlit run app.py + credentials in secrets file
    • your deployed is run via streamlit run app.py -- inspect
  • in 59:
    • self-hosted version is run via streamlit run app.py -- mystats + credentials in secrets file
    • your deployed version is run via streamlit run app.py

@comfy-home
Copy link
Copy Markdown
Contributor Author

*edit: just updated README file ; commit: 4642333

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