Identificazione dei principali nuovi contributori emergenti

La nostra prima prova è stata la classifica, ma sembra che dia più peso ai volumi puri (pensa a “È già stato corretto? È già stato corretto? È già stato corretto? Ciao?”) rispetto alla qualità. Ok, sì, la “qualità” è difficile da quantificare, anche se ci sono alcune modifiche ovvie da apportare.

Quello che abbiamo iniziato a fare per identificare gli utenti veramente utili è

cercare thread in cui un altro utente è il primo a rispondere
-- Obiettivo: Trovare argomenti in cui la prima risposta non-OP è di un non-SonarSourcer

WITH

SonarSourcers AS (
    SELECT u.id AS user_id
    FROM groups g
    INNER JOIN group_users gu ON g.id=gu.group_id
    INNER JOIN users u ON u.id = gu.user_id
    WHERE g.name='sonarsourcers'
),

tagged_topics AS (
    SELECT tt.topic_id
    FROM topic_tags tt
    JOIN tags t on t.id=tt.tag_id
    WHERE name = 'me-too'
)


-- trovare argomenti 'regolari' creati da utenti normali
,topic_user AS (
    SELECT id as topic_id, user_id, created_at
    FROM topics
    LEFT JOIN SonarSourcers ss USING(user_id)
    LEFT JOIN tagged_topics tt on topics.id = tt.topic_id
    WHERE ss.user_id IS NULL  -- omettere argomenti avviati da SonarSourcers
        AND tt.topic_id IS NULL -- omettere argomenti taggati con me-too
        AND user_id > 0  -- omettere i thread di benvenuto/tutorial di DiscoBot
        AND visible = TRUE
        AND archived = FALSE
        AND archetype='regular'
        AND created_at::DATE > '2023-07-01'
),

-- trovare la prima risposta non-OP agli argomenti utente
min_response AS (
    SELECT p.topic_id, tu.created_at, MIN(post_number) as post_number
    FROM posts p
    JOIN topic_user tu USING(topic_id)
    WHERE p.post_type = 1
        AND p.user_id != tu.user_id
        AND p.post_number > 1
        AND p.hidden = false
        AND p.deleted_at IS NULL
    GROUP BY topic_id, tu.created_at
)

SELECT p.topic_id, p.user_id, mr.created_at::DATE as thread_date
FROM posts p
JOIN min_response mr ON p.topic_id = mr.topic_id AND p.post_number=mr.post_number
LEFT JOIN SonarSourcers ss ON p.user_id=ss.user_id
LEFT JOIN user_badges ub on p.id = ub.post_id and ub.badge_id=110
WHERE ss.user_id IS NULL -- eliminare argomenti in cui SonarSourcer è il primo a rispondere
    AND ub.user_id IS NULL -- eliminare argomenti in cui un badge è già stato assegnato
ORDER BY mr.created_at DESC

Una volta identificati quei thread, valutiamo la risposta dell’utente e quindi assegniamo all’utente che ha risposto un badge “Utenti che aiutano gli utenti” o tagghiamo il thread con un tag “me-too” (invisibile agli staff). (A proposito, questo report sulle risposte degli utenti ha l’effetto collaterale positivo di individuare rapidamente gli incidenti nel nostro servizio cloud. :joy:)

Da lì diventa facile premiare ulteriormente gli utenti utili e identificarli per un ulteriore sviluppo.

5 Mi Piace