For an ideal gas constant volume heat addition process, change of entropy equation is:
$$\Delta S= c_v \ln\frac{T_2}{T_1}+ R \ln\frac{v_2}{v_1}= \int \frac{dq}{T}+S_{gen}$$
The term $R \ln\frac{v_2}{v_1}$ equals zero, since it’s a constant volume process.
For ideal gas $\int \frac{dq}{T} =c_v \ln\frac{T_2}{T_1}$ .
Then:
$$\Delta S= c_v \ln\frac{T_2}{T_1}= c_v \ln\frac{T_2}{T_1}+S_{gen}$$
Therefore, the $S_{gen}$ term equals zero and the process is reversible.
The question is: why does the $S_{gen}$ term equal zero and the process is reversible when this is a heat addition through a finite temperature difference?
To give a numerical example, imagine that an ideal gas is put in a rigid tank of uniform temperature where its initial temperature is $400$ K, and a hot reservoir at $500$ K. then heat is transferred from the hot reservoir to the rigid tank until the temperature of the rigid tank is $430$ K.
referring to the expressions above $T_1 =400$ K and $T_2 =430$ K.
Answer
The approach is to start from the definition of entropy change for a system $dS$ according to the laws of thermodynamics.
$$ dS \equiv \frac{\delta q}{T} $$
The heat flow $\delta q$ is path dependent and $T$ is the temperature of the system. We take a reversible path to find the reversible entropy change. We include an irreversible term as needed. Therefore, we write the expression below for the entropy change of a system under any process.
$$ \Delta S = \int \frac{\delta q_{rev}}{T} + \Delta S_{irr}$$
Reversible processes are those where the system and surroundings are in exact mechanical (equal pressures), thermal (equal temperatures), and chemical (equal chemical potentials) equilibrium at all points in time during the process. Such processes do not exist in the real world. They are hypothetical processes that allow us to make fundamental insights.
The difference between the entropy change of a system undergoing a reversible process $\Delta S_{rev}$ and the entropy change of a real world process is the irreversible entropy generation $\Delta S_{irr}$ or $S_{gen}$.
Ideal gases are also non-existent in the real world. They are however closely approximated by real gases to the point that we allow for the assumption even in practice.
For an ideal gas that undergoes a reversible change in temperature at constant volume, we obtain the following:
$$ dU^\star_{rev} = C_V dT = \delta q $$
$$ dS^\star_{rev} = C_v \frac{dT}{T} $$
$$ \Delta S^\star_{rev,V} = C_V \ln(T_f/T_i) $$
The last step requires that we assume that heat capacity is constant (the heat capacity of an ideal gases can depend only on temperature).
For an ideal gas that undergoes a reversible change in volume at constant temperature, we can also prove
$$ \Delta S^\star_{rev,T} = R \ln(V_f/V_i) $$
Combining the two expressions, we obtain the entropy change of an ideal gas with constant heat capacity undergoing any reversible change in temperature and volume as
$$ \Delta S^\star_{rev} = C_V \ln(T_f/T_i) + R \ln(V_f/V_i) $$
The total entropy change of the universe is the sum of the system and the surroundings. In a reversible process, the system and surroundings have the same entropy change. The total of the universe is therefore zero.
For an irreversible process, the entropy change of an ideal gas at constant heat capacity will still be the same as above. The irreversible entropy change is included and assigned to the surroundings. We use the term $S_{gen}$ to obtain
$$ \Delta S^\star_{univ} = \Delta S^\star_{sys} + \Delta S^\star_{surr} + S_{gen} = S_{gen}$$
The $S_{gen}$ term accounts for the fact that system and surroundings are not at perfect mechanical, thermal, or chemical equilibrium at all points in time during the process.
The entropy change of the system is found using a reversible path. The irreversibility is assigned to the surroundings. Using the definition of entropy, we can make the comparable statement $dS_{gen} = \delta q/T_{surr}$.
The founding equation starts with $\Delta S$. This is ambiguous. Is it to be $\Delta S_{univ}$, $\Delta S_{sys}$, or $\Delta S_{surr}$? This ambiguity should be clarified first.
The first expression after the equal sign is the entropy change for an ideal gas with constant heat capacity that undergoes a change in temperature and volume. Using only this term, we would intuitively set $\Delta S$ as $\Delta S_{sys}$. We cannot set it to $\Delta S_{univ}$. We can only set $\Delta S$ to $\Delta S_{surr}$ when we make the statement that the surroundings is an ideal gas.
The second expression is the entropy change of any generic irreversible process for any type of material. It could be viewed as $\Delta S_{sys}$ or $\Delta S_{surr}$. In the former case, $T = T_{sys}$. In the latter case, $T = T_{surr}$.
Let's now drop the ambiguous $\Delta S$ to obtain this.
$$C_V \ln(T_f/T_i) + R\ln(V_f/V_i) = \int \frac{\delta q}{T} + S_{gen}$$
The left side is the entropy change for an ideal gas under any process. This is the system. The right side is therefore the surroundings.
The fact that we include $S_{gen} \neq 0$ on the right side means that we are defining an irreversible process in the surroundings. The remaining term $\int \ldots$ must be the reversible entropy change of the surroundings. Therefore, $\delta q = \delta q_{rev,surr}$ and $T = T_{surr}$.
When the system is rigid, the term for $V_f/V_i$ drops from the left side. With temperatures $T_i = 400$ K, $T_f = 430$ K, and $T_{surr} = 500$ K, the expression becomes as below.
$$C_V \ln(430/400) = \int \frac{\delta q_{rev,surr}}{500} + S_{gen}$$
With the assumption that you know the material, you know $C_V$. You have one equation and one two unknowns. You have one of two approaches to an answer. You must state the amount of heat flow out of the surroundings ($\delta q_{rev,surr}$) as a constant. An immediate option is to say that this value is the reversible heat given to the system $\delta q_{rev,surr} = -\delta q_{rev,sys} = - C_V dT$. From this, you obtain
$$C_V \ln(430/400) = C_V \frac{400 - 430}{500} + S_{gen}$$
This allows you to solve for $S_{gen}$.
Alternatively, you must state the amount of irreversible entropy generated $S_{gen}$. When you also say that $\delta q_{rev,surr}$ is constant, you can solve for it.
Finally, with the parameters as given, the process is not reversible because the temperatures of the system and the surroundings are not the same at all stages. You could presume to call the process reversible so that $S_{gen} \equiv 0$. This means, you must ignore the temperature of the surroundings in your considerations. This gives the following:
$$C_V \ln(430/400) = \int \frac{\delta q_{rev,surr}}{T_{surr}}$$
With knowledge of the material, you use this to determine the reversible entropy change in the system or in the surroundings.