pycon.tw icon indicating copy to clipboard operation
pycon.tw copied to clipboard

[program] - 審稿系統 - 新增審稿各階段預設參數設定

Open PenguinRun opened this issue 11 months ago • 11 comments

主要需求:在審稿過程中,審稿會有每一個對應的階段。例如「投稿」、「審稿」...等各種階段。而這些階段需從 審稿設定文件中來改變階段,這部分是否有辦法能簡化流程。 發案組別:議程 發案者: @Xiao75896453

What problem does this feature solve?

目前依據審稿各階段不同,須從 Django 後台調整多項參數

What does the proposed feature look like?

希望新增 審稿各階段預設參數設定 將原先需手動逐一調整參數值,能夠依據設定的審稿階段,自動賦予對應預設值 希望讓操作更方便,不易設定錯誤

範例流程

  1. 選擇設定 審稿階段 第一階段投稿
  2. 系統自動將 Entries 各項參數設定為對應預設數值

PenguinRun avatar Mar 02 '24 09:03 PenguinRun

前人有想要簡化這個流程,方法是寫一個只能讓 admin 看得到的新頁面,頁面上有開關可以調整要切換到哪個 stage,但是當初的 PR #782 並未完成,看是要找人接手繼續修還是重新設計都可以

mattwang44 avatar Mar 20 '24 05:03 mattwang44

前人有想要簡化這個流程,方法是寫一個只能讓 admin 看得到的新頁面,頁面上有開關可以調整要切換到哪個 stage,但是當初的 PR #782 並未完成,看是要找人接手繼續修還是重新設計都可以

cc @tomatoprinx

SivanYeh avatar Mar 23 '24 09:03 SivanYeh

Hi @PenguinRun @mattwang44 @uranusjr

這兩天在這個 branch 上修改時遇到一些小問題,想請大大給點建議 在這個 PR 的分支上啟動專案時安裝 Python dependencies 的過程會遇到以下的錯誤訊息:

25.54 Collecting psycopg2-binary==2.8.5
25.58   Downloading psycopg2-binary-2.8.5.tar.gz (381 kB)
25.75     ERROR: Command errored out with exit status 1:
25.75      command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-atmldinl/psycopg2-binary_158f02844549439cbcf7e48049921462/setup.py'"'"'; __file__='"'"'/tmp/pip-install-atmldinl/psycopg2-binary_158f02844549439cbcf7e48049921462/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ijv6e48a
25.75          cwd: /tmp/pip-install-atmldinl/psycopg2-binary_158f02844549439cbcf7e48049921462/
25.75     Complete output (23 lines):
25.75     running egg_info
25.75     creating /tmp/pip-pip-egg-info-ijv6e48a/psycopg2_binary.egg-info
25.75     writing /tmp/pip-pip-egg-info-ijv6e48a/psycopg2_binary.egg-info/PKG-INFO
25.75     writing dependency_links to /tmp/pip-pip-egg-info-ijv6e48a/psycopg2_binary.egg-info/dependency_links.txt
25.75     writing top-level names to /tmp/pip-pip-egg-info-ijv6e48a/psycopg2_binary.egg-info/top_level.txt
25.75     writing manifest file '/tmp/pip-pip-egg-info-ijv6e48a/psycopg2_binary.egg-info/SOURCES.txt'
25.75
25.75     Error: pg_config executable not found.
25.75
25.75     pg_config is required to build psycopg2 from source.  Please add the directory
25.75     containing pg_config to the $PATH or specify the full executable path with the
25.75     option:
25.75
25.75         python setup.py build_ext --pg-config /path/to/pg_config build ...
25.75
25.75     or with the pg_config option in 'setup.cfg'.
25.75
25.75     If you prefer to avoid building psycopg2 from source, please install the PyPI
25.75     'psycopg2-binary' package instead.
25.75
25.75     For further information please check the 'doc/src/install.rst' file (also at
25.75     <https://www.psycopg.org/docs/install.html>).
25.75
25.75     ----------------------------------------
25.75 WARNING: Discarding https://files.pythonhosted.org/packages/97/00/ed4c82364741031d745867f83820d4f373aa891098a5785841850491c9ba/psycopg2-binary-2.8.5.tar.gz#sha256=ccdc6a87f32b491129ada4b87a43b1895cf2c20fdb7f98ad979647506ffc41b6 (from https://pypi.org/simple/psycopg2-binary/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
25.75 ERROR: Could not find a version that satisfies the requirement psycopg2-binary==2.8.5 (from versions: 2.7.4, 2.7.5, 2.7.6, 2.7.6.1, 2.7.7, 2.8, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.9, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 2.9.5, 2.9.6, 2.9.7, 2.9.8)
25.75 ERROR: No matching distribution found for psycopg2-binary==2.8.5
25.76 WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
25.76 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
------
failed to solve: process "/bin/sh -c pip3 install -r ./requirements/dev.txt" did not complete successfully: exit code: 1

在 psycopg2 專案找到幾相關的 issue: https://github.com/psycopg/psycopg2/issues/684 https://github.com/psycopg/psycopg2/issues/1368 意思應該是是指我這個分支上使用的 python:slim-buster 並沒有支援 psycopg2-binary 需要的 manylinux 標準(不確定這樣理解對不對? 參考 issue 下面有些解法好像也會冒出別的問題,想知道你們會怎麼解決這個問題?

另外補充一下,我至少到上個月在修改跟用這個方式 run server 都沒遇到以上 dependency 問題 目前個人是比較傾向先把原本分支的東西修改完再試著合併 main 分支的內容...因為差異真的是有點大

tomatoprinx avatar Jul 07 '24 08:07 tomatoprinx

在這個 branch 上修改時遇到一些小問題

這個是指 #782 的 branch 嗎?

有 rebase 到 main branch 上再嘗試過嗎?幾個月前 python (base image) & python packages 都有升版過,現在 psycopg2 已經升到 2.99

mattwang44 avatar Jul 07 '24 08:07 mattwang44

對我是在這個舊的分支上開發 不然我先試著把 main 合併進來再重新試好了,因為之前在這個分支上是可以跑起來的,所以才好奇怎麼突然不行了🤔

tomatoprinx avatar Jul 07 '24 08:07 tomatoprinx

ok, conflict 不好處理的話可以考慮 cherrypick commits 到新開的 branch 再重發 PR

mattwang44 avatar Jul 07 '24 08:07 mattwang44

按照 Matt 大大的建議開了一個新分支,然後把之前的東西先 cherrypicked 到上面了: https://github.com/pycontw/pycon.tw/pull/1204 接下來我會在這個 PR 上進行後續的 commit 🙏🏼🙏🏼

tomatoprinx avatar Jul 13 '24 16:07 tomatoprinx

@SivanYeh @mattwang44 css 苦手來求助一下 這個表單我 cherry-picked 之後裡面的文字顏色就跑掉了,感覺是要調整 .panel-title 的 color 但是我找不到要去哪裡改,感覺是從 main.scss 裡面調整之後 compile 出來的? Image

tomatoprinx avatar Jul 20 '24 06:07 tomatoprinx

的確就是改 .panel-title 的 color (link),搜 codebase 應該找得到?再看要改什麼顏色

image

mattwang44 avatar Jul 20 '24 09:07 mattwang44

感謝~我只是不太確定這邊改成什麼顏色會不會影響到官網的其他部分XD 索性把這邊有問題的文字顯示先都改成 color: black; 有問題的部分到 PR review 應該會比較一致

tomatoprinx avatar Jul 20 '24 18:07 tomatoprinx

你也可以看是 inherit 到哪裡然後去改那邊,這邊目前 color system 可能沒整理過但還是可以看怎麼做可以讓整個 style 比較一致

mattwang44 avatar Jul 21 '24 13:07 mattwang44